Learn R Programming

CUB (version 0.1)

cub0q: Main function for CUB models with covariates for the feeling component

Description

Function to estimate and validate a CUB model for given ordinal responses, with covariates for explaining the feeling component.

Usage

cub0q(m, ordinal, W, maxiter, toler, makeplot,summary)

Arguments

m
Number of ordinal categories
ordinal
Vector of ordinal responses
W
Matrix of selected covariates for explaining the feeling component, not including intercept
maxiter
Maximum number of iterations allowed for running the optimization algorithm
toler
Fixed error tolerance for final estimates
makeplot
Logical: if TRUE and if only one dichotomous covariate is included in the model, with levels (0,1), the function returns a graphical plot comparing the distributions of the responses conditioned to the value of the covariate
summary
logical: if TRUE, summary results of the fitting procedure are displayed on screen

Value

An object of the class "CUB"

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. (2010), A new statistical model for the analysis of customer satisfaction, #' Quality Technology and Quantity management, 7(2) 149--168 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.

Examples

Run this code
#running donttest option since the proposed examples require a long time run for check 

data(relgoods)
m=10
ordinal=relgoods[,29]
gender=relgoods[,2]
data=na.omit(cbind(ordinal,gender))
ordinal=data[,1]
W=data[,2]
makeplot=TRUE
maxiter=500           
toler=1e-6 
cubfit=cub0q(m,ordinal,W, maxiter, toler, makeplot, summary=TRUE)
param=cubfit$estimates      # Final ML estimates
pai=param[1]                # Estimated uncertainty parameter
gama=param[2:length(param)] # Estimated coefficients for feeling covariates
maxlik=cubfit$loglik
varmat=cubfit$varmat
niter=cubfit$niter
BIC=cubfit$BIC
###########################
data(univer)
m=7
global=univer[,12]
freqserv=univer[,2]
vercub0q=cub0q(m,global,W=freqserv,maxiter=300,toler=1e-4,makeplot=FALSE)
param=vercub0q$estimates      # Final ML estimates
pai=param[1]                  # Estimated uncertainty parameter
gama=param[2:length(param)]   # Estimated coefficients for feeling covariates
maxlik=vercub0q$loglik
varmat=vercub0q$varmat
niter=vercub0q$niter
BIC=vercub0q$BIC

Run the code above in your browser using DataLab