aldvmm.mm {aldvmm}R Documentation

Creating Design Matrices

Description

aldvmm.mm creates two design matrices, one of the model of component distributions ("beta") and one of the model of probabilities of component membership ("delta").

Usage

aldvmm.mm(data, formula, ncmp, lcoef)

Arguments

data

a data frame, list or environment (or object coercible to a data frame by
as.data.frame) including data on outcomes and explanatory variables in 'formula'.

formula

an object of class "formula" with a symbolic description of the model to be fitted. The model formula takes the form y ~ x1 + x2 | x1 + x4, where the | delimiter separates the model for expected values of normal distributions (left) and the multinomial logit model of probabilities of component membership (right).

ncmp

a numeric value of the number of components that are mixed. The default value is 2. A value of 1 represents a tobit model with a gap between 1 and the maximum value in 'psi'.

lcoef

a character vector of length 2 with labels of objects including regression coefficients of component distributions (default "beta") and coefficients of probabilities of component membership (default "delta").

Details

aldvmm.mm uses model.matrix to create design matrices for models of component distributions ("beta") and probabilities of component membership ("delta") based on 'formula' supplied to aldvmm.ll. The design matrix for probabilities of group membership is only created if more than one components are specified in 'ncmp'.

Value

a named list of numeric matrices.

beta

a numeric design matrix for the model of component distributions.

delta

a numeric design matrix of the multinomial logit model of probabilities of component membership.


[Package aldvmm version 0.8.4 Index]