applyCatAdjustmentToSimframe: Apply categorical adjustments to simframe.

View source: R/Simenv.r

applyCatAdjustmentToSimframeR Documentation

Apply categorical adjustments to simframe.

Description

Apply categorical adjustments to simframe.

Usage

applyCatAdjustmentToSimframe(
  Simenv,
  varnames,
  desired_props,
  iteration,
  propensities,
  print_adj = TRUE
)

Arguments

Simenv

simenv receiving object. Simenv$simframe is modified.

varnames

varname(s) of variable(s) to adjust, eg: "catpregsmk2" or c("z1msmokeLvl0","z1msmokeLvl1")

desired_props

a vector of desired proportions, eg: c(0.1, 0.1, 0.8). Can have a "logisetexpr" attribute - if so, this is evaulated, and becomes a logical vector indicating which observations of "varname" to adjust. (i.e. the "logisetexpr" attribute gives which subset of the data the desired_props are intended for).

iteration

the current iteration

propensities

named list of propensities for the cat.adjustments

printAdj

if TRUE will print new proportions of modified simframe vars

Value

NULL. simframe in receiving object is modified directly.


kcha193/simarioV2 documentation built on April 8, 2024, 4:51 p.m.