dss(X, d, totals, q = NULL, method = c("raking", "linear", "logit"), bounds = NULL, maxit = 500, ginv = gginv(), tol = 1e-06, attributes = FALSE)
X
."linear"
for the linear method,
"raking"
for the multiplicative method known as raking and
"logit"
for the logit method.NULL
, the
bounds are set to c(0, 10)
.ginv
). In
some cases it is possible to speed up the process by using
a function that computes a "regular" matrix inverse such as
{solve.default}
.success
, iterations
, method
and bounds
)
be added to the result? If FALSE
(default), a warning is given
if convergence within the given relative tolerance could not be achieved.Calibrate sample weights according to known marginal population totals. Based on initial sample weights, the so-called g-weights are computed by generalized raking procedures. The final sample weights need to be computed by multiplying the resulting g-weights with the initial sample weights.
This is a faster implementation of parts of
calib
from package sampling
. Note that the
default calibration method is raking and that the truncated linear method is
not yet implemented.
Deville, J.-C. and Särndal, C.-E. (1992) Calibration estimators in survey sampling. Journal of the American Statistical Association, 87(418), 376--382.
Deville, J.-C., Särndal, C.-E. and Sautory, O. (1993) Generalized raking procedures in survey sampling. Journal of the American Statistical Association, 88(423), 1013--1020.
obs <- 1000 vars <- 100 Xs <- matrix(runif(obs * vars), nrow = obs) d <- runif(obs) / obs totals <- rep(1, vars) g <- dss(Xs, d, totals, method = "linear", ginv = solve) g2 <- dss(Xs, d, totals, method = "raking")