View source: R/accessor-functions.R
| get_rep_scale_coefs | R Documentation |
Get the scale coefficients used for variance estimation in a replicate design object.
get_rep_scale_coefs(rep_design, type = "combined")
rep_design |
A replicate design object |
type |
Either |
For a statistic \hat{\theta},
replication methods estimate the sampling variance
using R replicate estimates, with the estimate
for the r-th replicate denoted \hat{\theta}_r.
The formula for the variance estimate is the following:
v(\hat{\theta}) = C \sum_{r=1}^{R} c_r (\hat{\theta_r} - \hat{\theta})^2
The terms C and c_r, r=1,\dots,R are scale coefficients.
C is the overall coefficient,
and c_r, r=1,\dots,R are replicate-specific coefficients.
Specifying get_rep_scale_coefs(type='overall') returns
the overall coefficient C. Specifying type='specific'
returns the replicate-specific coefficients c_r, r=1,\dots,R.
Specifying type='combined' returns a vector with
R elements,
where the r-th element is C \times c_r.
If type = 'overall', the result is a single number.
Otherwise, the result is a vector with length matching
the number of replicates.
data('api', package = 'survey')
api_design <- svydesign(
data = apistrat,
id = ~ 1,
strata = ~ stype,
weights = ~ pw,
nest = TRUE
)
jk_design <- api_design |>
as_random_group_jackknife_design(
replicates = 12
)
jk_design |>
get_rep_scale_coefs('overall')
jk_design |>
get_rep_scale_coefs('specific')
jk_design |>
get_rep_scale_coefs('combined')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.