View source: R/cap06-conglomerados-2etapas.R
| cong2_estima_proporcao | R Documentation |
Analogous to cong2_estima_media() but for a population proportion,
following Eqs. (6.24)-(6.29) of the course notes. Note that, unlike
cong2_estima_media(), the proportion estimator is inherently a
ratio-type estimator (structurally analogous to
cong2_estima_razao_media()) and therefore always uses the sample
average cluster size m_barra = mean(Mi) in its variance formula, even
when the population totals Nc/M are known – this is exactly how
Example 6.6 of the course notes computes it (using m_barra = 52.2
rather than M/Nc = 50, even though both M and Nc are known in
that example).
cong2_estima_proporcao(Mi, mi, pi_hat, Nc, M = NULL, conf = 0.95, ...)
Mi |
Numeric vector with the population size of each sampled cluster. |
mi |
Numeric vector with the number of sampled elements in each cluster. |
pi_hat |
Numeric vector with the sample proportion of each cluster (Eq. 6.24). |
Nc |
Total number of clusters in the population. |
M |
Ignored (kept for signature symmetry with
|
conf |
Confidence level, default |
... |
Ignored (see package overview on tolerated extra arguments). |
A sampling_result object with the estimated proportion, its
variance, and confidence interval.
Mi <- c(50, 65, 45, 48, 52, 58, 42, 66, 40, 56)
mi <- c(10, 13, 9, 10, 10, 12, 8, 13, 8, 11)
pi_hat <- c(0.4, 0.3077, 0.3333, 0.3, 0.3, 0.25, 0.375, 0.3077, 0.375, 0.3636)
cong2_estima_proporcao(Mi = Mi, mi = mi, pi_hat = pi_hat, Nc = 90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.