prorate.row: Adjust data row by row to sum to control totals

prorate.rowR Documentation

Adjust data row by row to sum to control totals

Description

Reconcile row by row, when using region control totals, while updating initial estimates of male/female regional total values if difference is NOT zero, adjust actual data. This function will be run iteratively through each row of a dataframe already prepared 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.

Usage

prorate.row(CurrRow, n_colGrps, allowNegatives)

Arguments

CurrRow

a dataframe of a row to prorate

n_colGrps

the number of groups to adjust over (e.g., number of groups in region)

allowNegatives

a logical of whether negative population values are allowed (usually FALSE)

Value

original dataframe of row, that is now prorated by the adjustment values

See Also

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(), read.inputs(), real.to.int(), rename.age.grps(), rounded()


bcgov/dbutils documentation built on Sept. 30, 2022, 12:04 a.m.