margins_for_rake: Sample and population margins for raking

View source: R/margins_for_rake.R

margins_for_rakeR Documentation

Sample and population margins for raking

Description

This function can be used to construct the sample.margins and population.margins arguments for rake.

Usage

margins_for_rake(me_vars, int_vars, interact_with, design)

Arguments

me_vars

character vector of variable names for main effects.

int_vars

character vector naming variables to be interacted with interact_with.

interact_with

character string naming the variable with which the variables in int_vars will be interacted. Currently interact_with can only be a single variable.

design

survey object. See svydesign.

Value

A list with components samp and pop. samp is a list of formulas describing sample margins. pop is a list of data.frames and tables describing the corresponding population margins. See the description of the sample.margins and population.margins arguments for rake.


jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.