reweight(ori, mar, raw=NA, wgt=NA, unique=T, bound=c(0, 100),
trace=F, tolerance=0.1, penalty=0, ...)
"print"(x, ...)
"summary"(object, ...)
"plot"(x, ...)
ori
. ori
. Default is all one's.ori
. Default is the value of raw
. ori
matrix is already unique. If FALSE
, it will be made so by
aggregating the non-unique lines, along with raw
and wgt
.
Default is TRUE
.TRUE
, show the path of the golden selection
search of best regularization parameter $r$. Default is FALSE
.penalty
and $q$ is the percentage
of zero weighting ratios. Default is 0 (no penalty).reweight
.reweight
.ori
, raw
, wgt
typically come from survey
data with categorical responses. The intent is to adjust the wgt
so that the survey sample is more representative of the universe from
where it comes. It is accomplished by fitting the marginal distributions
of the sample to those of the universe, or those from a more precise
source (e.g. census data). The method is based on the Tikhonov
regularization.The print
method prints out the weight ratios, along with their
corresponding factor level combinations. This data can then be matched
back to the original sample data to adjust the original weights (by
multipling each original weight with the weight ratio).
The summary
method prints out various running statistics.
The plot
method makes a panel of four diagnostic plots.
pumswgt
data(pumswgt)
r1 <- reweight(pumswgt$ori,pumswgt$mar,pumswgt$wgt)
plot(r1)
summary(r1)
r2 <- reweight(pumswgt$ori,pumswgt$mar,pumswgt$raw)
plot(r2)
summary(r2)
w <- print(r2)
Run the code above in your browser using DataLab