prorate | R Documentation |
Prorating is for adjusting data to control totals in only 1 dimension. Use dbRake to adjust data in 2 dimensions.
prorate(data, control, VarRow, allowNegatives = FALSE)
data |
a dataframe to prorate (one row per VarRow) |
control |
a dataframe of control totals (one row per VarRow) |
VarRow |
a character, the name of the variable to prorate on (e.g., when prorating Sex for LHA to region control totals, VarRow = "Region") |
allowNegatives |
a logical of whether negative population values are allowed (usually FALSE) |
This function iteratively adjusts each row of data by running prorate.row
which
first prepares rows by running through calc.cols
while the row's difference is not zero.
For example, for 1:n_Sex, prorate
so that region totals sum to region control totals. This is a helper function used in dbRake
.
original dataframe, that is now prorated by the adjustment values
This function not currently integrated into dbRake
The overall raking function: dbRake
()
Other raking helpers:
add.random.fraction.to.cols()
,
adjustSex()
,
allowNegsnoMargin()
,
calc.cols()
,
multiRake()
,
noNegsneedMargin()
,
noNegsnoMargin()
,
prep.prorate.col()
,
prorate.col()
,
prorate.row()
,
read.inputs()
,
real.to.int()
,
rename.age.grps()
,
rounded()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.