Learn R Programming

Greg (version 1.2)

prCaAddReference: Adds a reference to value matrix

Description

Adds a reference to value matrix

Usage

prCaAddReference(vn, var_order, values, add_references_pos, reference_zero_effect, ds, use_labels)

Arguments

vn
Variable name
var_order
The output from the prMapVariable2Name
values
The value matrix
add_references_pos
The position where a reference should be added. Sometimes you don't want the reference to be at the top, for instance if you have age groups then you may have < 25, 25-39, 40-55, > 55 and you have the reference to be 25-39 then you should set the reference list for age_groups as add_references_pos = list(age_groups = 2) so that you have the second group as the position for the reference.
reference_zero_effect
Used with references, tells if zero effect is in exponential form, i.e. exp(0) = 1, or in regular format, i.e. 0 = 0 (can be set to any value)
ds
The data set
use_labels
If the rowname.fn function doesn't change the name then the label should be used instead of the name, that is if there is a label and it isn't a factor.

Value

matrix A matrix with rgroup and n.rgroup attributes

See Also

Other printCrudeAndAdjusted functions: prCaAddRefAndStat, prCaAddUserReferences, prCaGetImputationCols, prCaGetRowname, prCaGetVnStats, prCaPrepareCrudeAndAdjusted, prCaReorderReferenceDescribe, prCaReorder, prCaSelectAndOrderVars, prCaSetRownames, printCrudeAndAdjustedModel