rakeadj {rake} | R Documentation |
The marginal total weights of the rake object are adjusted to match
the population marginal total weights specified by marg
. As a
result, the total weights of each class of rake
will be
adjusted, and these adjusted weights can be used for estimation.
This is the second function in the rake
, rakeadj
,
predict.rake
Rake analysis series.
rakeadj(rake, marg, verbose)
rake |
Object of class "rake" created with rake . |
marg |
The population marginal total weights. This may be
specified in any of the following ways:
numeric: vector of marginal total weights, matched to the values in rake by name.
data.frame: column "weight" must contain the weights, matched by names specified in column "name". character: filename of an appropriate table that will be read as a data.frame . |
verbose |
logical: Should the number of iterations for the rake adjustment to converge be printed? |
Rake adjustment via rakeadj
is accomplished by, for each class,
dividing by the marginal total weights of the class, then multiplying
by the marginal total weight specified by marg
.
After performing the rake adjustment above on each class in the rows
of rake
, the
marginal totals of the rows of rake
match the target marginal totals
specified by marg
, but the marginal totals of the columns of
rake
do not match the target marginal totals. So, the rake
adjustment is then performed on each class of the columns of
rake
, which then syncs the column marginal totals but unsyncs
the row marginal totals.
By repeatedly performing the rake adjustment, the marginal
totals of the columns and rows of rake
eventually converge to
the marginal totals specified by marg
.
Object of class "rake", with adjusted weights.
Toby Dylan Hocking <tdhock@ocf.berkeley.edu>
Sharon L. Lohr. Sampling: Design and Analysis, pp. 269-271. Brooks/Cole, Pacific Grove, CA, 1999.
rake
for creating the initial "rake" class object,
predict.rake
for making estimates with the adjusted weight
values,
simpleRake
for performing the entire Raking process.
example(rake) r <- rakeadj( r, statpoptotal, TRUE ) print(r)