mmlcrcomponentinit {mmlcr}R Documentation

Initialize an ‘mmlcr’ component

Description

Used internally by mmlcr to initialize an mmlcr component. The function is generic.

Usage

mmlcrcomponentinit(object, n.groups,  prob, data, grouping)

Arguments

object see details below
n.groups the number of classes. Provided by mmlcr.
prob a data.frame of (initial) posterior probabilities of class membership. Provided by mmlcr.
data a data.frame. Provided by mmlcr.
grouping the variable of data indicating subject id. Provided by mmlcr.

Details

The object argument is a list, originally provided to the mmlcr function as a component of a list in the components argument. At a minimum, that list consists of a formula of the form resp ~ covars, where resp is the response variable for that component and covars are any additional covariates (resp ~ 1 is commonly used), and a class. For longitudinal responses, the covariates should include the chronological variable, e.g., resp ~ poly(age, 2). Implemented classes include cnormlong, cnormonce, multinomlong, multinomonce, nblong, nbonce, normlong, normonce, poislong, and poisonce. The *long classes are for longitudinal responses, while the *once classes are for one-time responses. So that a rectangular data structure can be used for the data argument in mmlcr, the *once classes use just the first occurence of a response for each subject.

The cnorm* classes are for censored normal distributions. They take a min and max argument for the minimum and maximum possible observed value. The multinom* classes are for multinomial, or categorical responses. The response variable should be a factor. The nb* classes are for negative binomial models (the usual overdispersed Poisson model). The norm* classes are for normal models, and the pois* classes are for Poisson models. For the cnorm* and norm* classes the minimum and maximum variances are constrained to be within a factor of 100 of each other. For the pois* classes an overdispersion estimate is calculated but not used.

Value

an mmlcr component object.

See Also

mmlcr, mmlcrObject


[Package mmlcr version 1.3.5 Index]