Main function to estimate and validate a CUBE model for given ratings, explaining uncertainty, feeling and overdispersion.

1 |

`Formula` |
Object of class Formula. |

`data` |
Data frame from which model matrices and response variables are taken. |

`...` |
Additional arguments to be passed for the specification of the model, Including Y, W, Z for explanatory variables for uncertainty, feeling and overdispersion. Set expinform=TRUE if inference should be based on expected information matrix for model with no covariate. Set starting = ... to pass initial values for EM iterations. |

It is the main function for CUBE models, calling for the corresponding functions whenever
covariates are specified: it is possible to select covariates for explaining all the three parameters
or only the feeling component.

The program also checks if the estimated variance-covariance matrix is positive definite: if not,
it prints a warning message and returns a matrix and related results with NA entries.
The optimization procedure is run via "optim". If covariates are included only for feeling,
the variance-covariance matrix is computed as the inverse of the returned numerically differentiated
Hessian matrix (option: hessian=TRUE as argument for "optim"), and the estimation procedure is not
iterative, so a NULL result for $niter is produced.
If the estimated variance-covariance matrix is not positive definite, the function returns a
warning message and produces a matrix with NA entries.

An object of the class "GEM"-"CUBE" is a list containing the following results:

`estimates` |
Maximum likelihood estimates: |

`loglik` |
Log-likelihood function at the final estimates |

`varmat` |
Variance-covariance matrix of final estimates |

`niter` |
Number of executed iterations |

`BIC` |
BIC index for the estimated model |

Iannario M. (2014). Modelling Uncertainty and Overdispersion in Ordinal Data,
*Communications in Statistics - Theory and Methods*, **43**, 771–786

Piccolo D. (2015). Inferential issues for CUBE models with covariates,
*Communications in Statistics. Theory and Methods*, **44**(23), 771–786.

Iannario M. (2015). Detecting latent components in ordinal data with overdispersion by means
of a mixture distribution, *Quality & Quantity*, **49**, 977–987

Iannario M. (2016). Testing the overdispersion parameter in CUBE models.
*Communications in Statistics: Simulation and Computation*, **45**(5), 1621–1635.

`probcube`

, `loglikCUBE`

, `loglikcuben`

, `inibestcube`

,
`inibestcubecsi`

, `inibestcubecov`

,
`varmatCUBE`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
data(relgoods)
ordinal<-na.omit(relgoods[,37])
model<-CUBE(ordinal,starting=c(0.1,0.1,0.1))
model$estimates # Final ML estimates
model$loglik # Maximum value of the log-likelihood function
model$varmat
model$niter
model$BIC
########################
ordinal<-relgoods[,40]
cov<-relgoods[,2]
nona<-na.omit(cbind(ordinal,cov))
modelcovcsi<-CUBE(nona[,1],W=nona[,2])
modelcov<-CUBE(nona[,1],Y=nona[,2],W=nona[,2], Z=nona[,2])
modelcov$BIC
modelcovcsi$BIC
#######################################
data(univer)
ordinal<-univer[,8]
starting<-inibestcube(m,ordinal)
model<-CUBE(ordinal,starting=starting)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.