preLoglin
and
missmodel
. A default method operates on matrices and data frames.
daLoglin(object, ...)
"preLoglin"
or
"missmodel"
.
margins
,
prior
,
start
, and
control
which affect the data augmentation algorithm model and
algorithm. Additional arguments are possible. See the specific
function called for a list of all possible arguments.
"missmodel"
is returned; see
for details.
daLoglin
creates the data set
.Random.seed
if it does not already exist, otherwise its value is updated.
The
daLoglin
function computes data augmentation estimates of the
cell probabilities in hierarchical log-linear models. A hierarchical
log-linear model is a multinomial model that predicts the log of the
cell probabilities for the multinomial as a linear factorial model. In
a hierarchical model the inclusion of an interaction effect
automatically means that all dependent lower level effects are
included in the model. For example, for factors
A
,
B
, and
C
,
inclusion of
A:B:C
automatically means that
A
,
B
,
C
,
A:B
,
A:C
, and
B:C
are also included in the model.
In this algorithm Markov Chain Monte Carlo (MCMC) methods are used
to (1) iteratively simulate data for the missing values, and
(2) simulate parameters given the augmented data. Because data augmentation
results in a Markov chain, care must be taken to ensure that
a steady state solution has been reached. You can assess this
from the sequence of parameter iterates
returned as the
paramIter
component
of the class
"missmodel"
object returned by the
daLoglin
function.
These may be analyzed using routines such a
plot.missmodel
,
worstFunLin
.
The function
impLoglin
may use the
missmodel
object
produced by
daLoglin
as starting values.
Because the
daLoglin
function is often called more than once, it is
usually preferable to precompute many of the statistics used by
daLoglin
by first calling the
preLoglin
function.
Agresti, A. (1990),
Categorical Data Analysis ,
John Wiley & Sons, New York.
Bishop, Y. M. M., Fienberg, S. E., and Holland, H. W.
Discrete Multivariate Analysis: Theory and Practice ,
MIT Press, Cambridge,
Schafer, J. L. (1997),
Analysis of Incomplete Multivariate Data ,
Chapman & Hall, London.
daLoglin(object = crime, margins = count~Visit.1:Visit.2, control = list(save = 101:500)) #same as: daLoglin.default(object = crime, margins = count~Visit.1:Visit.2, control = list(save = 101:500)) attach(crime) crime.pre <- preLoglin(data = crime, frequency = count, control = list(save = 101:500)) daLoglin(crime.pre, margins = ~Visit.1:Visit.2, control = list(save = 101:500)) #same as: daLoglin.preLoglin(crime.pre, margins = ~Visit.1:Visit.2, control = list(save = 101:500)) crime.em <- emLoglin(object = crime, margins = count~Visit.1:Visit.2) daLoglin.missmodel(object = crime.em, control = list(save = 101:500))