as.weight {plink}R Documentation

Calibration Weights

Description

This function facilitates the creation of either a set of quadrature weights or weights based on a set of theta values for use in the function plink

Usage

as.weight(n, theta, weight, quadrature = FALSE, normal.wt = FALSE, dimensions = 1, ...)

Arguments

n numeric value or vector identifying the number of theta values to use for each dimension. If only one value is supplied but dimensions is greater than one, n will be the same for all dimensions.
theta vector or list of theta values. If dimensions is greater than one, list elements should correspond to each dimension, otherwise the single vector will be repeated for all dimensions.
weight vector or list of weights. If dimensions is greater than one, list elements should correspond to each dimension, otherwise the single vector will be repeated for all dimensions.
quadrature if TRUE, quadrature points and weights will be computed for the corresponding number of points n for each dimension respectively. See gauss.quad.prob for more information on creating quadrature points and weights.
normal.wt if TRUE and weight is missing, the weights for theta will be computed to correspond to the densities from a normal distribution.
dimensions number of dimensions for which the weights should be created
... further arguments passed to other methods

Details

When weighting expected response probabilities at different theta values using characteristic curve linking methods, there are a variety of approaches one can take. These range from uniform weights to normal weights, to quadrature weights corresponding to some a priori specified distribution. The purpose of this function is to facilitate the creation of these weights for use in plink .

For all approaches, when more than one dimension is specified, the weights for each combined set of theta values will be a multiplicative weight. For example, if there are two dimensions and the specified weights corresponding to two specific theta values on each dimension respectively are 0.8 and 1.2, the final weight for this pair of theta values will be 0.96.

Uniform Weights
Six general approaches can be used to create uniform weights.
Non-Uniform Weights
Four general approaches can be used to create non-uniform weights.

See Kolen & Brennan (2004) for more information on calibration weights.

Value

Returns a list of length two. The first list element is an n x m matrix of theta values for m dimensions. The second list element is a vector of weights corresponding to the theta values in the first list element.

Author(s)

Jonathan P. Weeks weeksjp@gmail.com

References

Kolen, M. J., & Brennan, R. L. (2004) Test Equating, Scaling, and Linking. New York: Springer

See Also

plink, gauss.quad.prob

Examples

###### Unidimensional Examples ######
# Create a set of 40 (default) theta values and uniform weights
wt <- as.weight()

# Create a set of 40 quadrature points and weights using a standard normal distribution
wt <- as.weight(quadrature=TRUE)

# Create a set of 30 quadrature points and weights using a normal distribution
# with a mean of 0.5
wt <- as.weight(n=30, quadrature=TRUE, mu=0.5)

# Create weights for a set of random normal theta values
wt <- as.weight(theta=rnorm(100))

# Create an object with equal interval theta values and standard normal density weights
wt <- as.weight(theta=seq(-4,4,0.05), normal.wt=TRUE)

# Create an object with equal interval theta values and normal density weights
# with a mean of 0.5 and SD equal to .92
wt <- as.weight(theta=seq(-4,4,0.05), normal.wt=TRUE, mean=0.5, sd=0.92)

###### Multidimensional Examples ######
# Create a set of 49 theta values and uniform weights (based on seven points for each dimension)
wt <- as.weight(dimensions=2)

# Create a set of 100 quadrature points and weights using a normal distribution
# with a means of 0 and 0.5 for the two dimensions respectively
wt <- as.weight(n=10, quadrature=TRUE, mu=c(0,0.5), dimensions=2)

# Create an object with equal interval theta values and standard normal density weights
# for three dimensions
wt <- as.weight(theta=seq(-3,3), normal.wt=TRUE, dimensions=3)

# Create an object with two sets of equal interval theta values for two dimensions
wt <- as.weight(theta=list(seq(-4,4),seq(-3,3)), dimensions=2)

# Create an object with two sets of random normal theta values and standard normal
# density weights for two dimensions
wt <- as.weight(theta=list(rnorm(10),rnorm(10)), normal.wt=TRUE, dimensions=2)

[Package plink version 1.0.0 Index]