Learn R Programming

svrep (version 0.9.1)

get_rep_scale_coefs: Access Replication Scale Coefficients

Description

Get the scale coefficients used for variance estimation in a replicate design object.

Usage

get_rep_scale_coefs(rep_design, type = "combined")

Value

If type = 'overall', the result is a single number. Otherwise, the result is a vector with length matching the number of replicates.

Arguments

rep_design

A replicate design object

type

Either 'overall', 'specific', or 'combined'. See the details section below. The result for 'overall' is the single overall scale coefficient. The result for 'specific' is the vector of replicate-specific coefficients. The result for 'combined' is the product of the overall and replicate-specific coefficients.

Details

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\).

Examples

Run this code
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')

Run the code above in your browser using DataLab