After fitting a log-linear model with cvam
,
the fitted model object may be passed to this function to obtain estimated
marginal and conditional probabilities for model factors.
cvamEstimate(estimate, obj, meanSeries = TRUE,
confidence = obj$control$confidence,
probRound = obj$control$probRound, probDigits = obj$control$probDigits, ...)# S3 method for cvamEstimate
print(x, showHeader = TRUE, ...)
# S3 method for cvamEstimateList
print(x, showHeader = TRUE, ...)
if estimate
is a single formula, this function returns a data
frame containing
estimated probabilities, standard errors, and endpoints of approximate
confidence intervals. If estimate
is a list of formulas, then a
list of data frames is returned.
a formula or list of formulas indicating the desired probabilities; see DETAILS.
an object produced by cvam
containing
results from a model fit
applies when obj
contains results from a
simulation run.
If TRUE
, then the requested estimates are computed based on
a running mean of cell probabilities over all iterations
after the burn-in period. If FALSE
, then the requested
estimates are based only on the cell probabilities from the final
iteration, and (assuming the run was sufficiently long, if it is MCMC)
can be regarded as a single draw from their posterior distribution.
confidence coefficient for asymmetric interval estimates; see DETAILS.
if TRUE, probabilities will be rounded.
number of digits for rounding probabilities.
a set of estimates to be printed.
if TRUE
, a descriptive header is printed.
additional arguments to be passed to print
.
Joe Schafer Joseph.L.Schafer@census.gov
The argument estimate
should be a one-sided formula or a list
of one-sided formulas, with variables separated by `+
', and
variables to be conditioned on appearing after `|
'. For
example, ~ A
requests marginal probabilities for every level of
A
;
~ A + B | C + D
requests conditional probabilities for
every level combination of A
and B
given every level
combination of C
and D
.
If obj
was produced with saturated=FALSE
and
method="EM"
, then standard errors for all
probabilities are computed using Taylor linearization, also known as
the delta method, based on the asymptotic covariance matrix for the
log-linear coefficients.
If obj
was produced with saturated=FALSE
and
method="MCMC"
or "approxBayes"
, then standard errors are
computed with Taylor
linearization, based on the covariance matrix for the simulated log-linear
coefficients from all iterations after the burn-in period.
If obj
was produced with saturated=TRUE
, then
standard errors are not computed.
A symmetric confidence interval for a probability may be problematic, especially if the estimate is close to zero or one. Asymmetric confidence intervals are computed by applying a normal approximation on the logistic (log-odds) scale and translating the endpoints back to the probability scale.
For more information, refer to the package vignette Log-Linear Modeling with Missing and Coarsened Values Using the cvam Package.
cvam
cvamPredict
cvamImpute
cvamLik
fit <- cvam( ~ Sex * PolViews * AbAny, data=abortion2000 )
cvamEstimate( list( ~ AbAny | Sex, ~ AbAny | PolViews ), fit )
Run the code above in your browser using DataLab