insert: Insert DIF-corrected variable into original data frame

Description Usage Arguments Value Author(s) References See Also Examples

Description

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).

Usage

1
insert(data, obj, vnames, overwrite, debug)

Arguments

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

Value

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.

Author(s)

Olivia Lau

References

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

See Also

anchors,cpolr

Examples

1
2
3
4
data(freedom)
ra <- anchors(self ~ vign1 + vign3 + vign6, data = freedom, method="B")
freedom <- insert(freedom, ra ) 
names(freedom)

anchors documentation built on May 2, 2019, 6:59 a.m.