| as.weight {plink} | R Documentation |
This function facilitates the creation of weights for a set of theta values for
use in the function plink
as.weight(theta1 = NULL, weight1 = NULL, theta2 = NULL, weight2 = NULL, normal.wt = FALSE)
theta1 |
vector of theta values for the set of TO item parameters
(i.e. the item parameters that will not be transformed) |
weight1 |
vector of weights corresponding to theta1. They must
sum to one. |
theta2 |
vector of theta values for the set of FROM item parameters
(i.e. the item parameters that will be transformed) |
weight2 |
vector of weights corresponding to theta2. They must
sum to one. |
normal.wt |
if TRUE and weight1 is NULL, the weights for
theta1 and theta2 will be computed to correspond to the
densities from a normal distribution. |
If no theta values are supplied, the values for theta1 and theta2 will
be equal interval values ranging from -4 to 4 with an increment of 0.05. If values are
only supplied for theta1, the values for theta2 will equal those of
theta1. If values are supplied for theta1 and theta2, the length
of the two vectors must be equal.
If no weights are supplied, the values for weight1 and weight2 will
be equal to 1/n for n theta values. If values are only supplied for weight1, the
values for weight2 will equal those of weight1. If values are supplied
for weight1 and/or weight2, the length of the vector(s) should be equal
to the length of the theta vector(s). If values are supplied for weight1 or
weight2, normal.wt will be ignored.
See Kolen & Brennan (2004) for more information on calibration weights.
Returns a list of length two. The first list element is an n x 2 matrix of theta values
corresponding to theta1 and theta2. The second list element is an
n x 2 matrix of weights corresponding to weight1 and weight2.
When normal.wt equals TRUE, theta1 and theta2 are
standardized to determine normal density weights
Jonathan Weeks weeksjp@gmail.com
Kolen, M. J., & Brennan, R. L. (2004) Test Equating, Scaling, and Linking. New York: Springer
# Create a set of default theta values and weights wt <- as.weight() # Create weights for a set of random normal theta values wt <- as.weight(rnorm(100)) # Create an object with equal interval theta values and normal density weights wt <- as.weight(normal.wt=TRUE) # Create an object with random normal theta values and normal density weights wt <- as.weight(rnorm(100),normal.wt=TRUE)