prorate.col: Adjust data column by column to sum to row totals

prorate.colR Documentation

Adjust data column by column to sum to row totals

Description

Reconcile column by column, 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 column of a dataframe already prepared by running through prep.prorate.col while the column'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.col(CurrCol, n_rowGrps, allowNegatives)

Arguments

CurrCol

a dataframe of a column to prorate

n_rowGrps

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


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