Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ESS

Compute effective sample size of weighted sample


Description

Computes the effective sample size (ESS) of a weighted sample, which represents the size of an unweighted sample with approximately the same amount of precision as the weighted sample under consideration.

Usage

ESS(w)

Arguments

w

a vector of weights

Details

The ESS is calculated as sum(w)^2/sum(w^2).

References

McCaffrey, D. F., Ridgeway, G., & Morral, A. R. (2004). Propensity Score Estimation With Boosted Regression for Evaluating Causal Effects in Observational Studies. Psychological Methods, 9(4), 403–425. doi: 10.1037/1082-989X.9.4.403

Shook-Sa, B. E., & Hudgens, M. G. (2020). Power and Sample Size for Marginal Structural Models. ArXiv:2003.05979 [Stat]. https://arxiv.org/abs/2003.05979

See Also

Examples

library("cobalt")
data("lalonde", package = "cobalt")

#Balancing covariates between treatment groups (binary)
(W1 <- weightit(treat ~ age + educ + married +
                  nodegree + re74, data = lalonde,
                method = "ps", estimand = "ATE"))
summary(W1)
ESS(W1$weights[W1$treat == 0])
ESS(W1$weights[W1$treat == 1])

WeightIt

Weighting for Covariate Balance in Observational Studies

v0.12.0
GPL (>= 2)
Authors
Noah Greifer [aut, cre] (<https://orcid.org/0000-0003-3067-7154>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.