optim.const.ordi: performs the M step for the measurement distribution...

Description Usage Arguments Details Value Examples

View source: R/optim.const.ordi.R

Description

Estimates the cumulative logistic coefficients alpha in the case of multinomial (or ordinal) data with an ordinal constraint on the parameters.

Usage

1
optim.const.ordi(y, status, weight, param, x = NULL, var.list = NULL)

Arguments

y

a matrix of discrete (or ordinal) measurements (only for symptomatic subjects),

status

symptom status of all individuals,

weight

a matrix of n times K of individual weights, where n is the number of individuals and K is the total number of latent classes in the model,

param

a list of measurement density parameters, here is a list of alpha,

x

a matrix of covariates (optional). Default id NULL,

var.list

a list of integers indicating which covariates (taken from x) are used for a given type of measurement

Details

the constraint on the parameters is that, for a symptom j, the rows alpha[[j]][k,] are equal for all classes k except the first values. Therefore, maximum likelihood estimators are not explicit and the function lrm of the package rms is used to perform a numerical optimization.

Value

The function returns a list of estimated parameters param satisfying the constraint.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#data
data(ped.ordi)
status <- ped.ordi[,6]
y <- ped.ordi[,7:ncol(ped.ordi)]
data(peel)
#probs and param
data(probs)
data(param.ordi)
#e step
weight <- e.step(ped.ordi,probs,param.ordi,dens.prod.ordi,peel,x=NULL,
                 var.list=NULL,famdep=TRUE)$w
weight <- matrix(weight[,1,1:length(probs$p)],nrow=nrow(ped.ordi),
                 ncol=length(probs$p))
#the function
optim.const.ordi(y[status==2,],status,weight,param.ordi,x=NULL,
                 var.list=NULL)

LCAextend documentation built on May 2, 2019, 2:02 a.m.