cube000: Main function for CUBE models without covariates

Description Usage Arguments Value References Examples

View source: R/cube000.R

Description

Estimate and validate a CUBE model without covariates.

Usage

1
cube000(m, ordinal, starting, maxiter, toler, expinform)

Arguments

m

Number of ordinal categories

ordinal

Vector of ordinal responses

starting

Vector of initial estimates to start the optimization algorithm, whose length equals the number of parameters of the model

maxiter

Maximum number of iterations allowed for running the optimization algorithm

toler

Fixed error tolerance for final estimates

expinform

Logical: if TRUE, the function returns the expected variance-covariance matrix

Value

An object of the class "CUBE"

References

Iannario, M. (2014). Modelling Uncertainty and Overdispersion in Ordinal Data, Communications in Statistics - Theory and Methods, 43, 771–786
Iannario, M. (2015). Detecting latent components in ordinal data with overdispersion by means of a mixture distribution, Quality & Quantity, 49, 977–987

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
### Applying donttest option since the proposed examples require long time run for check

data(relgoods)
m=10
ordinal=na.omit(relgoods[,37])
starting = rep(0.1, 3)
fitcube=cube000(m, ordinal, starting, maxiter=500, toler=1e-6, makeplot=TRUE, expinform=FALSE,
        summary=T)
param=fitcube$estimates
pai=param[1]           # ML estimate for the uncertainty parameter
csi=param[2]           # ML estimate for the feeling parameter
phi=param[3]           # ML estimate for the overdispersion parameter
maxlik=fitcube$loglik
niter=fitcube$niter
BIC=fitcube$BIC
###################
data(univer)
m=7
ordinal=univer[,8]
starting=inibestcube(m,ordinal)
model=cube000(m,ordinal,starting,maxiter=200,toler=1e-4,makeplot=TRUE,expinform=TRUE,summary=F)
param=model$estimates   # Final ML estimates (pai,csi,phi)
maxlik=model$loglik
model$varmat
model$niter
model$BIC

CUB documentation built on Nov. 17, 2017, 6:37 a.m.