insert {anchors} | R Documentation |
Insert the DIF corrected variable into the original data frame, with missing values for observations for which it was impossible to calculate DIF correction (due to missingness in either the self-response or one or more of the vignette responses).
insert(data, obj, vnames, overwrite, debug)
data |
Original data frame |
obj |
anchors.rank class object |
vnames |
A list of character vectors of length 2,which represent the
variable names (in the output data frame) for the lower and upper
bounds, respectively, of the DIF corrected variables.
By default, this will be derived from column names of B and C in the anchors.rank object: B=c("Bs", "Be"),C=c("Cs", "Ce") . |
overwrite |
A logical value (defaults to FALSE ).
Indicates whether to overwrite variables with names the same as
colnames already exist in data . |
debug |
Default: 0 |
A data frame, with the same number of observations as the input
data
, but with two or four additional variables, corresponding
to the lower and upper bounds of the DIF corrected variable.
Olivia Lau
Jonathan Wand, Gary King and Olivia Lau. (2007) ``Anchors: Software for Anchoring Vignettes''. Journal of Statistical Software. Forthcoming. copy at http://wand.stanford.edu/research/anchors-jss.pdf
data(freedom) ra <- anchors(self ~ vign1 + vign3 + vign6, data = freedom, method="B") freedom <- insert(freedom, ra ) names(freedom)