cvamImpute | R Documentation |
After fitting a log-linear model with cvam
,
the fitted model object may be passed to this function, along with a
dataset containing missing or coarsened values, to randomly impute the
true data from their predictive distribution given the
observed data and parameters from the fitted model.
cvamImpute(obj, data, freq, meanSeries = FALSE, synthetic=FALSE)
obj |
an object produced by |
data |
data frame for imputation, possibly different from the
data used to fit the model contained in |
freq |
variable containing frequencies for
|
meanSeries |
applies when |
synthetic |
if |
a data frame containing imputed data. If freq
was given,
the data frame has one row for each cell in the complete-data table
and a variable freq
containing the frequencies. If freq
was not given, the data frame has one row for each microdata observation.
When this function is used within a process for multiple imputation,
meanSeries
should
be set to FALSE
, otherwise the imputations will not correctly reflect
uncertainty about model parameters.
Joe Schafer Joseph.L.Schafer@census.gov
For more information, refer to the package vignette Log-Linear Modeling with Missing and Coarsened Values Using the cvam Package.
cvam
,
cvamEstimate
,
cvamPredict
,
cvamLik
# impute from a grouped dataset with frequencies fit <- cvam( ~ V1 * V2, freq=n, data=crime ) cvamImpute( fit, data=crime, freq=n ) # impute microdata fit <- cvam( ~ Sex * PolViews * AbAny, data=abortion2000 ) impData <- cvamImpute( fit, data=abortion2000 ) head(impData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.