Learn R Programming

svytest (version 1.1.0)

estim_eq_test: Estimating Equations Test for Informative Sampling (Linear Case)

Description

Implements the Pfeffermann-Sverchkov estimating equations test for informativeness of survey weights in the linear regression case (Gaussian with identity link). The test compares unweighted estimating equations to adjusted-weight equations using \(q_i = w_i / E_s(w_i \mid x_i)\).

Usage

estim_eq_test(
  model,
  coef_subset = NULL,
  q_method = c("linear", "log"),
  stabilize = TRUE,
  na.action = stats::na.omit
)

# S3 method for estim_eq_test print(x, ...)

# S3 method for estim_eq_test summary(object, ...)

# S3 method for estim_eq_test tidy(x, ...)

# S3 method for estim_eq_test glance(x, ...)

Value

An object of class "estim_eq_test" containing:

statistic

Hotelling F statistic

p.value

p-value under F distribution

df1

Numerator df (# tested coefficients)

df2

Denominator df (n - p)

Rbar

Mean estimating-equation contrast vector

S

Sample covariance of R

terms

Names of tested coefficients

n

Sample size

call

Matched call

method

Description string

Arguments

model

An object of class svyglm with family = gaussian(identity).

coef_subset

Optional character vector of coefficient names to include in the test. Defaults to all coefficients in the model matrix.

q_method

Method for estimating \(E_s(w \mid x)\): "linear" (default, OLS regression of w on X) or "log" (regress log(w) on X, then exponentiate).

stabilize

Logical; if TRUE (default) clips extreme q values.

na.action

Function to handle missing data.

x

An object of class estim_eq_test

...

Additional arguments passed to methods

object

An object of class estim_eq_test

Details

For linear regression, the per-observation score is \(u_i = x_i (y_i - x_i^\top \hat\beta_{\text{unw}})\) at the unweighted OLS estimate. The test statistic is based on \(R_i = (1 - q_i) u_i\), where \(q_i = w_i / E_s(w_i \mid x_i)\). The Hotelling F statistic is \(F = \frac{n-p}{p} \bar R^\top S^{-1} \bar R\), with df1 = p, df2 = n - p.

References

Pfeffermann, D., & Sverchkov, M. Y. (2003). Fitting generalized linear models under informative sampling. In R. L. Chambers & C. J. Skinner (Eds.), *Analysis of Survey Data* (Ch. 12). Wiley.

See Also

diff_in_coef_test, wa_test, perm_test

Examples

Run this code
# Load in survey package (required) and load in example data
library(survey)
data("svytestCE", package = "svytest")

# Create a survey design and fit a weighted regression model
des <- svydesign(ids = ~1, weights = ~FINLWT21, data = svytestCE)
fit <- svyglm(TOTEXPCQ ~ ROOMSQ + BATHRMQ + BEDROOMQ + FAM_SIZE + AGE, design = des)

# Run estimating equations diagnostic test; reports F statistic, df's, and p-value
results <- estim_eq_test(fit, q_method = "linear")
print(results)

Run the code above in your browser using DataLab