CUB: Main function for CUB models

Description Usage Arguments Details Value References See Also Examples

View source: R/CUB.R

Description

Main function to estimate and validate a CUB model for explaining uncertainty and feeling for given ratings, with or without covariates and shelter effect.

Usage

1
CUB(Formula, data, ...)

Arguments

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 covariates matrices Y, W, X for #' for uncertainty, feeling and shelter, respectively.

Details

This is the main function for CUB models, which calls for the corresponding functions whenever covariates or shelter effect are specified. It performs maximum likelihood estimation via the E-M algorithm for CUB models and extensions. The optimization procedure is run via "optim".
It is possible to fit data with CUB models, with or without covariates for the parameters of the mixture model, and CUB models with shelter effect with no covariate included in the model. 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.

Value

An object of the class "GEM"-CUB": returns 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

References

Piccolo D. and D'Elia A. (2008). A new approach for modelling consumers' preferences, Food Quality and Preference, 18, 247–259
Iannario M. and Piccolo D. (2012). CUB models: Statistical methods and empirical evidence, in: Kenett R. S. and Salini S. (eds.), Modern Analysis of Customer Surveys: with applications using R, J. Wiley and Sons, Chichester, 231–258
Iannario M. (2012). Modelling shelter choices in a class of mixture models for ordinal responses, Statistical Methods and Applications, 21, 1–22
Iannario M. and Piccolo D. (2014). Inference for CUB models: a program in R, Statistica & Applicazioni, XII n.2, 177–204
Iannario M. (2016). Testing the overdispersion parameter in CUBE models, Communications in Statistics: Simulation and Computation, 45(5), 1621–1635

See Also

probcub00, probcubp0, probcub0q, probcubpq, probcubshe1, loglikCUB, varmatCUB

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
data(relgoods)
ordinal<-na.omit(relgoods[,40]) 
model<-CUB(ordinal)     
estpar<-model$estimates  # Estimated parameter vector (pai,csi)
maxlik<-model$loglik     # Log-likelihood function at ML estimates
vmat<-model$varmat
nniter<-model$niter
BICCUB<-model$BIC
################
## CUB model with shelter effect
data(univer)
officeho<-univer[,10]
model<-CUB(officeho,shelter=7)
BICcub<-model$BIC
################
## CUB model with covariates for all components - GeCub
data(univer)
officeho<-univer[,10]
gender<-relgoods[,7]
model<-CUB(officeho,shelter=7,Y=gender,W=gender,X=gender)
BICcub<-model$BIC
################
## CUB model with covariate for uncertainty
data(relgoods)
ordinal<-relgoods[,26] 
gender<-relgoods[,7]
data<-na.omit(cbind(ordinal,gender))
modelcovpai<-CUB(data[,1],Y=data[,2])
BICcovpai<-modelcovpai$BIC
## CUB model with covariate for feeling
data(univer)
ordinal<-univer[,12]
freqserv<-univer[,2]
modelcovcsi<-CUB(ordinal,W=freqserv)
##################
## CUB model with covariates for both components
data(univer)
gender<-univer[,4]
lage<-log(univer[,3])-mean(log(univer[,3]))
ordinal<-univer[,12]
maxiter<-500; toler<-1e-6;
model<-CUB(ordinal,Y=gender,W=lage) 
param<-model$estimates
bet<-param[1:2]      # ML estimates of coefficients for uncertainty covariate
gama<-param[3:4]     # ML estimates of coefficients for feeling covariate

CUB documentation built on Feb. 9, 2018, 6:14 a.m.