Skip to contents

This function calculates the expected Kish design effect from weighting for the next survey wave, given a set of selection probabilities modelled by coefficients beta.

Usage

calculate_deff(beta, X, pop_pct, u_h_omega, n_h_omega, pi_h, ...)

Arguments

beta

A numeric vector of coefficients for the selection probability model.

X

A model matrix for the strata (H rows x K columns).

pop_pct

A numeric vector of the population proportion in each stratum.

u_h_omega

A numeric vector of the number of un-responded units in each stratum.

n_h_omega

A numeric vector of the number of already responded units in each stratum.

pi_h

A numeric vector of the estimated response propensity in each stratum.

...

Additional arguments (not used, for compatibility with optimisers).

Value

A single numeric value for the expected design effect.

Examples

data(zimbabwe_minisample)
pop_frame_example <- setup_pop_frame(zimbabwe_minisample,
                                     strata_vars = c("gender", "region"))
X_mat <- model.matrix(~ h, data = pop_frame_example)
beta_initial <- rep(0, ncol(X_mat))

calculate_deff(
  beta = beta_initial,
  X = X_mat,
  pop_pct = pop_frame_example$pop_pct,
  u_h_omega = pop_frame_example$u_h_omega,
  n_h_omega = pop_frame_example$n_h_omega,
  pi_h = pop_frame_example$pi_hat_h
)
#> [1] 1