After fitting a log-linear model with cvam
,
the fitted model object may be passed to this function, along with a
dataset that may contain missing or coarsened values, to compute
the likelihood of each pattern of possibly incomplete or
coarsened data for subset of variables,
possibly conditioned upon another subset of variables
cvamLik(form, obj, data, meanSeries = TRUE)
A data frame containing the model variables, with a variable
likVall
holding the likelihood values
a formula indicating which variables to consider, and which variables to condition on, when computing the likelihood
an object produced by cvam
containing
results from a model fit
data frame for computing the likelihood values,
possibly different from the data used to fit the model contained in
obj
applies when obj
contains results from a
simulation run.
If TRUE
, then the requested likelihood values are based on
a running mean of cell probabilities over all iterations
after the burn-in period. If FALSE
, then the requested
values are based only on the cell probabilities from the final
iteration, and (assuming the run was sufficiently long, if MCMC)
can be regarded as a single draw from their posterior distribution.
Joe Schafer Joseph.L.Schafer@census.gov
For structural zeros, 0/0
is returned as 0
. If any
variables are being conditioned on in form
, they must not
contain any missing or coarsened values.
For more information, refer to the package vignette Log-Linear Modeling with Missing and Coarsened Values Using the cvam Package.
cvam
,
cvamEstimate
,
cvamImpute
,
cvamPredict
result <- cvam( ~ V1 * V2, freq=n, data=crime)
cvamLik( ~ V1 + V2, result, data=crime )
Run the code above in your browser using DataLab