adjust.proportions: A wrapper for modifyProps. Subsets by the logiset call the...

View source: R/modifyProps.r

adjust.proportionsR Documentation

A wrapper for modifyProps. Subsets by the logiset call the appropriate version of modifyProps (modifyPropsContinuous or modifyProps) then, if modifyProps was called on a logiset, combine and reorder the data using combine.and.reorder(). Called in adjustCatVar(), adjustContVar, and applyContAdjustmentToSimframe().

Description

A wrapper for modifyProps. Subsets by the logiset call the appropriate version of modifyProps (modifyPropsContinuous or modifyProps) then, if modifyProps was called on a logiset, combine and reorder the data using combine.and.reorder(). Called in adjustCatVar(), adjustContVar, and applyContAdjustmentToSimframe().

Usage

adjust.proportions(
  x,
  desiredProps,
  propens = NULL,
  logiset = NULL,
  catToContModels = NULL,
  cont.binbreaks = NULL,
  envir = parent.frame()
)

Arguments

x

A categorical vector to be adjusted.

desiredProps

Vector of desired proportions

propens

propensity scores used to decide who should change categories

logiset

A TRUE/FALSE vector indicating the subset of units to apply the scenari (change in proportions) to

catToContModels

A list of models which will to used to convert the adjusted categorical variable back to continuous.

cont.binbreaks

Binbreaks for the variable being adjusted if exist. Used to ensure the imputed continuous values (only for continuous variables) are within the bounds of the category.

envir

environment - for the MELC MSM is usually the simframe of the scenario environment.

Value

an adjusted vector, either categorical or continuous depending on whether catToCont models were provided.


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