post_stratification_helper: Post stratification estimator helper

View source: R/helpers-multilevel-regression-poststratification.R

post_stratification_helperR Documentation

Post stratification estimator helper

Description

Calculates predicted values from a multilevel regression and the post-stratified state-level estimates

Usage

post_stratification_helper(model_fit, data, group, weights)

Arguments

model_fit

a model fit object from, e.g., glmer or lm_robust

data

a data.frame

group

unquoted name of the group variable to construct estimates for

weights

unquoted name of post-stratification weights variable

Details

Please see https://book.declaredesign.org/observational-descriptive.html#multi-level-regression-and-poststratification

Value

data.frame of post-stratified group-level estimates


rdss documentation built on Oct. 11, 2024, 1:08 a.m.