weight_x: Calculate weight matrix from matrix of covariates

Description Usage Arguments Value Author(s) References Examples

Description

Calculate a vector of weights relating vector xrow with the rows of xmat, according to the weights in vector carwt. For each row in xmat, the positions of agreement with xrow are found. The weight for that row of xmat is then the sum of the elements of carwt corresponding to the matches.

Usage

1
weight_x(xrow, xmat, carwt)

Arguments

xrow

vector used for matching

xmat

matrix of covariates

carwt

vector of weight for each match

Value

Vector of weights relating vector xrow to the rows of xmat

Author(s)

Xiaoshu Zhu xiaoshuzhu@westat.com and Sharon Lohr

References

Lohr, S. and X. Zhu (2015). Randomized Sequential Individual Assignment in Social Experiments: Evaluating the Design Options Prospectively. Sociological Methods and Research. [Advance online publication: December 27, 2015] doi: 10.1177/0049124115621332.

Examples

1
2
3
4
5
xrow <- c(1,0,1,1)
xmat <- matrix(rbinom(60,1,.4),ncol=4)
carwt <- c(.6,.4,.2,.1)

weight_x(xrow, xmat, carwt)

SeqAlloc documentation built on May 2, 2019, 3:14 p.m.