This function computes the mean and variance of a proportion from clustered binomial data \((n, y)\), using various methods. Confidence intervals are computed using a normal approximation, which might be inappropriate when the proportion is close to 0 or 1.
varbin(n, y, data, alpha = 0.05, R = 5000)
An object of formal class “varbin”, with 5 slots:
The call of the function.
A 4-column data frame giving for each estimation method the mean, variance, upper and lower limits of the \((1 - \alpha)\) confidence interval.
A numeric vector containing the R bootstrap replicates of the proportion. Might be used to compute other kinds of CI's for the proportion.
The significance level used to compute the \((1 - \alpha)\) confidence intervals.
A numeric vector with 3 components summarizing the main features of the data: N
= number
of clusters, n
= number of subjects, y
= number of cases.
The “show” method displays the slot tab
described above, substituting the standard error to the variance.
The denominator of the proportion.
The numerator of the proportion.
A data frame containing the data.
The significance level for the confidence intervals. Default to 0.05, providing 95% CI's.
The number of bootstrap replicates to compute the bootstrap mean and variance.
Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr
Five methods are used for the estimations. Let us consider \(N\) clusters of sizes \(n_1, \ldots, n_N\) with observed responses (counts) \(y_1, \ldots, y_N\). We note \(p_i = y_i / n_i\) the observed proportions \((i = 1, \ldots, N)\). An underlying assumption is that the theoretical proportion is homogeneous across the clusters.
Binomial method: the proportion and its variance are estimated as \(p = \frac{\sum_{i} y_i}{\sum_{i} n_i}\) and \(\frac{p * (1 - p)}{\sum_{i} n_i - 1}\), respectively.
Ratio method: the one-stage cluster sampling formula is used to estimate the variance of the ratio estimate (see Cochran, 1999, p. 32 and p. 66). The proportion is estimated as above (\(p\)).
Arithmetic method: the proportion is estimated as \(p_A = \frac{1}{N}\sum_{i}\frac{y_i}{n_i}\), with estimated variance \(\frac{\sum_{i}(p_i - p_A)^2}{N * (N - 1)}\).
Jackknife method: the proportion \(p_J\) is the arithmetic mean of the pseudovalues \(pv_i\), with estimated variance \(\frac{\sum_{i}(pv_i - p_J)^2}{N * (N - 1)}\) (Gladen, 1977, Paul, 1982).
Bootstrap method: \(R\) samples of size \(N\) are drawn with equal probability from the initial sample \((p_1, \ldots , p_N)\) (Efron and Tibshirani, 1993). The bootstrap estimate \(p_B\) and its estimated variance are the arithmetic mean and the empirical variance (computed with denominator \(R - 1\)) of the \(R\) binomial estimates, respectively.
Cochran, W.G., 1999, 3th ed. Sampling techniques. Wiley, New York.
Efron, B., Tibshirani, R., 1993. An introduction to the bootstrap. Chapman and Hall, London.
Gladen, B., 1977. The use of the jackknife to estimate proportions from toxicological data in the presence
of litter effects. JASA 74(366), 278-283.
Paul, S.R., 1982. Analysis of proportions of affected foetuses in teratological experiments.
Biometrics 38, 361-370.
varbin-class
, boot
data(rabbits)
varbin(n, y, rabbits[rabbits$group == "M", ])
by(rabbits,
list(group = rabbits$group),
function(x) varbin(n = n, y = y, data = x, R = 1000))
Run the code above in your browser using DataLab