Learn R Programming

FastCUB (version 0.0.2)

fastCUB: Main function for fast estimation CUB models

Description

Main function to estimate and validate a CUB model for explaining uncertainty and feeling for given ratings, with or without covariates, on the basis of Louis' identity for the information matrix and the derived accelerated estimation.

Usage

fastCUB(Formula, data, mix=FALSE, tolmix=1e+2,fmix= NULL,...)

Value

An object of the class "fastCUB": returns a list containing the following results:

estimates

Maximum likelihood estimates of model parameters

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

parnames

Names for model parameters

Arguments

Formula

Object of class Formula with two right-hand side: the first for uncertainty covariates, the second for feeling covariates.

data

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

mix

Logical: should a first preliminary standard EM be run at toler equal to tolmix? (default is FALSE).

tolmix

Convergence tolerance for first preliminary EM (if mix=TRUE).

fmix

Fraction of iteration needed for preliminary EM (if mix=TRUE). Default is null.

...

Additional arguments to be passed for the specification of the model and the acceleration steps.

Details

This is the main function for CUB models, which calls for the corresponding functions whenever covariates are specified. It performs maximum likelihood estimation via the E-M algorithm for CUB models and extensions based on the Louis'identity for the observed information matrix.

See Also

probcub00, probcubp0, probcub0q, probcubpq

Examples

Run this code
# \donttest{
library(FastCUB)
data(univer)
ordinal<-univer$global
m<-7
effe<-with(univer, Formula(global~0|gender+freqserv+age +changefa))
cub0q<-fastCUB(effe,data=univer,m=7, maxiter=100,toler=1e-8,mix=TRUE,verbose=FALSE)
summary(cub0q)
## Fast EM for  CUB model with covariates only for uncertainty
effe<-with(univer, Formula(global~gender+freqserv+age +changefa|0))
cubp0<-fastCUB(effe,data=univer,m=7, maxiter=100,toler=1e-8,iterc=5,verbose=TRUE)
## Fast EM for  CUB model with covariates for both feeling and uncertainty
effe<-with(univer, Formula(global~gender+freqserv+age +changefa|gender+freqserv+age +changefa))
cubpq<-fastCUB(effe,data=univer,m=7, maxiter=100,toler=1e-8,iterc=5)
summary(cubpq)
BIC(cubpq)
# }

Run the code above in your browser using DataLab