Learn R Programming

LCAextend (version 1.3)

optim.noconst.ordi: performs the M step for the measurement distribution parameters in multinomial case without constraint on the parameters

Description

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

Usage

optim.noconst.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 distribution parameters, here is a list alpha of cumulative logistic coefficients,

x

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

var.list

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

Value

the function returns a list of estimated parameters param.

Details

The values of explicit estimators are computed by logistic transformation of weighted empirical frequencies.

Examples

Run this code
# NOT RUN {
#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.noconst.ordi(y[status==2,],status,weight,param.ordi,x=NULL,
                   var.list=NULL)
# }

Run the code above in your browser using DataLab