preCgm(data, margins, gauss, subset)
margins
argument is not
provided, then the loglinear part of the model is assumed to be a
saturated model in which all
factor
variables are used to form the
table. If the
gauss
argument is not provided, then all numeric
variables in the data frame are included in the conditional Gaussian
part of the model.
margins
argument,
which identifies the variables to use in the discrete part
of the model. If the
gauss
argument is omitted, then all remaining
variables in the matrix are used in the Gaussian part of the
model.
list(1:2, 3:4)
would indicate fitting the
1,2 margin (summing over variables 3 and 4) and the 3,4 margin in a four-way
table. This same model can be specified using the names of the variables (e.g.,
list(c("V1", "V2"), c("V3", "V4"))
), or using
formula notation, as in
margins = ~V1:V2 + V3:V4
.
When formula notation is used, the argument
frequency
can be included as the dependent variable
(as in
margins = frequency~V1:V2 + V3:V4
).
c(1, 2, 4)
, as a
vector of variable names, e.g.
c("V1", "V2", "V4")
, and using
formula notation, e.g.
~V1+V2+V4
. If argument
gauss
is
omitted, then all numeric variables (which do not appear in argument
margins
) are used in the multivariate gaussian model.
data
is a data frame,
this expression may use variables in the data frame.
"preCgm"
; see
for details.
A significant amount of preprocessing is required before a data set
can be analyzed using the data augmentation or EM algorithms.
preCgm
performs this preprocessing. In repeated calls to the
data augmentation, EM, or impute routines, performing this
preprocessing once can speed the computations.
language.pre <- preCgm(data = language)