adjwgt | R Documentation |
Adjust initial survey design weights so that the
final weights sum to a desired frame size. Adjusted weights
proportionally scale the initial weights to sum to the desired frame size.
Separate adjustments are applied to each category specified in wgtcat
.
adjwgt(wgt, wgtcat = NULL, framesize, sites = NULL)
wgt |
Vector of initial weights for each site. These equal the reciprocal of the site's inclusion probability. |
wgtcat |
Vector containing each site's weight adjustment
category name. The default is |
framesize |
Vector containing the known size of the frame
for each category name in |
sites |
Vector indicating site use; |
Vector of adjusted weights, where the adjusted weight is set
to 0
for sites whose value in the sites argument was set to
FALSE
.
Tony Olsen olsen.tony@epa.gov
wgt <- runif(50)
wgtcat <- rep(c("A", "B"), c(30, 20))
framesize <- c(A = 15, B = 10)
sites <- rep(rep(c(TRUE, FALSE), c(9, 1)), 5)
adjwgt(wgt, wgtcat, framesize, sites)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.