svyassocmod {logmult} | R Documentation |
Fitting Association Models With Complex Survey Data
Description
Fit association models to data from a complex survey design, with inverse-probability weighting and (optionally) standard errors based on replicate weights.
Usage
svyrc(formula, design, nd = 1,
symmetric = FALSE, diagonal = FALSE,
weighting = c("marginal", "uniform", "none"),
rowsup = NULL, colsup = NULL,
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NULL, etastart = NULL, tolerance = 1e-8,
iterMax = 5000, trace = FALSE, verbose = TRUE, ...)
svyhmskew(formula, design, nd.symm = NA, diagonal = FALSE,
weighting = c("marginal", "uniform", "none"),
rowsup = NULL, colsup = NULL,
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NULL, etastart = NULL, tolerance = 1e-8,
iterMax = 5000, trace = FALSE, verbose = TRUE, ...)
svyyrcskew(formula, design, nd.symm = NA, nd.skew = 1, diagonal = FALSE,
weighting = c("marginal", "uniform", "none"),
rowsup = NULL, colsup = NULL,
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NA, etastart = NULL, tolerance = 1e-8,
iterMax = 15000, trace = FALSE, verbose = TRUE, ...)
svyrcL(formula, design, nd = 1,
layer.effect = c("homogeneous.scores",
"heterogeneous", "none"),
symmetric = FALSE,
diagonal = c("none", "heterogeneous", "homogeneous"),
weighting = c("marginal", "uniform", "none"),
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NULL, etastart = NULL, tolerance = 1e-8,
iterMax = 5000, trace = FALSE, verbose = TRUE, ...)
svyrcL.trans(formula, design, nd = 1,
symmetric = FALSE,
diagonal = c("none", "heterogeneous", "homogeneous"),
weighting = c("marginal", "uniform", "none"),
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NULL, etastart = NULL, tolerance = 1e-8,
iterMax = 5000, trace = FALSE, verbose = TRUE, ...)
svyhmskewL(formula, design, nd.symm = NA,
layer.effect.skew = c("homogeneous.scores", "heterogeneous",
"none"),
layer.effect.symm = c("heterogeneous", "uniform",
"homogeneous.scores", "none"),
diagonal = c("none", "heterogeneous", "homogeneous"),
weighting = c("marginal", "uniform", "none"),
Ntotal = nrow(design), exclude = c(NA, NaN),
se = c("none", "replicate"),
ncpus = getOption("boot.ncpus"),
family = quasipoisson, weights = NULL,
start = NULL, etastart = NULL, tolerance = 1e-8,
iterMax = 5000, trace = FALSE, verbose = TRUE, ...)
Arguments
formula |
a formula specifying margins for the table (using ‘+’ only)
on which the model will be fitted (passed to
|
design |
a survey object; if |
nd |
the number of dimensions to include in the model. Cannot exceed
|
nd.symm |
the number of dimensions to include in the symmetric RC(M) association. Cannot exceed
|
nd.skew |
the number of dimensions to include in the skew-symmetric RC(M) association. |
layer.effect |
determines the form of the interaction between row-column association and layers. See “Details” below. |
layer.effect.skew |
determines the form of the interaction between skew-symmetric association and layers. See “Details” below. |
layer.effect.symm |
determines the form of the interaction between symmetric row-column association,
or quasi-symmetric association (if |
symmetric |
should row and column scores be constrained to be equal? Valid only for square tables. |
diagonal |
what type of diagonal-specific parameters to include in the model, if any. Only makes sense
when |
weighting |
what weights should be used when normalizing the scores. |
Ntotal |
sum of counts to normalize the table to (passed to |
exclude |
a vector of values to be exclude when building the table, passed to |
rowsup |
if present, a matrix with the same columns as |
colsup |
if present, a matrix with the same rows as |
se |
whether to compute replicate standard errors or not (only supported for |
ncpus |
the number of processes to use for jackknife or bootstrap parallel computing. Defaults to
the number of cores (see |
family |
a specification of the error distribution and link function
to be used in the model. This can be a character string naming
a family function; a family function, or the result of a call
to a family function. See |
weights |
an optional vector of weights to be used in the fitting process. |
start |
either |
etastart |
starting values for the linear predictor; set to |
tolerance |
a positive numeric value specifying the tolerance level for convergence; higher values will speed up the fitting process, but beware of numerical instability of estimated scores! |
iterMax |
a positive integer specifying the maximum number of main iterations to perform; consider raising this value if your model does not converge. |
trace |
a logical value indicating whether the deviance should be printed after each iteration. |
verbose |
a logical value indicating whether progress indicators should be printed, including a diagnostic error message if the algorithm restarts. |
... |
more arguments to be passed to |
Details
The model is fitted to a table with probabilities estimated by
svytable
and (when Ntotal = nrow(design)
)
with the sample size equal to the observed sample size, treating the
resulting table as if it came from iid multinomial sampling, as described
by Rao and Scott. This assumption affects the fit statistics but not parameter
point estimates.
Standard errors that do not rely on this assumption can be computed
by fitting the model using each series of replicate weights. If your
data does not come with replicate weights, use
as.svrepdesign
to create them first, and pass
the resulting svrepdesign
object via the
design
argument.
Value
An assocmod
object whose exact class depends on the function called.
Note
Note that printed fit statistics and degrees of freedom rely on the
iid assumption. This is also the case of the variance-covariance matrix
returned by the vcov.gnm
function.
Author(s)
Milan Bouchet-Valat
References
Rao, J.N.K., Scott, A.J. (1984). On Chi-squared Tests For Multiway Contingency Tables with Proportions Estimated From Survey Data. Annals of Statistics 12, 46-60.
See Also
rc
, hmskew
, yrcskew
, rcL
,
rcL.trans
, hmskewL
svytable
, svyloglin
,
svyglm
, as.svrepdesign