Preprocessor for Conditional Gaussian Model Routines

DESCRIPTION:

Sorts and groups the data for subsequent analysis by a conditional Gaussian model routine which handles missing values using EM or data augmentation algorithms.

USAGE:

preCgm(data, margins, gauss, subset) 

REQUIRED ARGUMENTS:

data
a data frame or matrix containing the raw data.

When a data frame is input and if the 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.

When a matrix is input, you must provide the 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.

OPTIONAL ARGUMENTS:

margins
a formula or a list of vectors containing the marginal totals to be fit. A margin is described by the factors not summed over. Thus 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).
gauss
identifies the variables to be used in the Gaussian part of the model. These variables may be specified in three ways: as a vector of variable indices, e.g., 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.
subset
expression specifying which rows of the data should be used in the fit. This can be a logical vector (which is replicated to have length equal to the number of rows), a numeric vector indicating the observation numbers to be included, or a character vector of the row names to be included. All observations are included by default. If data is a data frame, this expression may use variables in the data frame.

VALUE:

an object of class "preCgm"; see for details.

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.

SEE ALSO:

, , , .

EXAMPLES:

language.pre <- preCgm(data = language)