effective_sample_size: Calculate effective sample size from weights

View source: R/design_effect.R

effective_sample_sizeR Documentation

Calculate effective sample size from weights

Description

This function calculates the effective sample size implied by the supplied weights. Because weighting inflates variance of quantities of interest, the effective sample size of a weighted sample is less than the nominal sample size. This function calls design_effect. If an outcome is not provided, design_effect implements the estimator from Kish (1992), which assumes no correlation between weights and outcomes. If an outcome is provided, the function implements Spencer (2000).

Usage

effective_sample_size(weights, outcome = NULL)

Arguments

weights

The weights for which an implied effective sample size is designed

outcome

An vector outcome of interest. If NULL, this function returns the Kish (1992) estimator of design effects. If numeric data is provided, this function returns the Spencer (2000) estimator of design effects conditional on the correlation between supplied weights and the outcome of interest.

Value

A numeric effective sample size, which may be non-integer.


aaronrudkin/autumn documentation built on Feb. 5, 2024, 6:08 p.m.