cvamPredict | 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 predict one or more
variables from their predictive distribution given the
observed data and parameters from the fitted model.
cvamPredict(form, obj, data, freq, meanSeries = TRUE, sep = ".")
form |
a one-sided formula indicating the variable or
variables to be predicted, with variables separated by ' |
obj |
an object produced by |
data |
data frame for prediction, possibly different from the
data used to fit the model contained in |
freq |
variable containing frequencies for
|
meanSeries |
applies when |
sep |
character sting used to separate the levels of multiple variables being predicted |
Predictions from this function are unlike predictions from a regression model. In regression, prediction is to compute the estimated mean response ar specific values of the predictors. With this function, predictions are based on the predictive distribution for one or more variables given all the observed data, including the variable(s) to be predicted if they are seen. The prediction for a variable that is seen will assign a probability of one to the seen value and zero probability to other values.
A data frame containing the predicted probabilities or frequencies,
with an attribute colFrame
that identifies its columns
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
,
cvamImpute
,
cvamLik
fit <- cvam( ~ V1 + V2, freq=n, data=crime ) cvamPredict( ~ V1, fit, data=crime, freq=n ) # predict frequencies cvamPredict( ~ V1, fit, data=crime ) # predict probabilities
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.