Learn R Programming

nonprobsampling (version 0.1.0)

compute_D_raking: Compute design-based covariance matrix D for calibration

Description

Internal helper to compute $$D = Var_p\left( \sum_{j \in s_p} d_j x_j \right)$$ from an existing survey design object created by survey::svydesign() or survey::svrepdesign().

Usage

compute_D_raking(sp_des, Xp)

Value

A `p x p` covariance matrix `D`.

Arguments

sp_des

A survey design object of class `"survey.design2"` or `"svyrep.design"`.

Xp

Numeric matrix of dimension `n_p x p`. Each row is the covariate vector `x_j` used in the calibration estimating equation.

Details

In the raking ratio calibration method, the probability sample contribution in the estimating equation is \(d_j x_j\), so the design-based covariance matrix is obtained by treating \(h_j = x_j\) as the survey total variable.