insert {anchors}R Documentation

Insert DIF-corrected variable into original data frame

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

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


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


[Package anchors version 3.0-8 Index]