Learn R Programming

CUB (version 0.1)

inibestcubecov: Preliminary parameter estimates for CUBE models with covariates

Description

Compute preliminary parameter estimates for a CUBE model with covariates for all the three parameters. These estimates are set as initial values to start the E-M algorithm within maximum likelihood estimation.

Usage

inibestcubecov(m, ordinal, Y, W, Z)

Arguments

m
Number of ordinal categories
ordinal
Vector of ordinal responses
Y
Matrix of selected covariates to explain the uncertainty parameter
W
Matrix of selected covariates to explain the feeling parameter
Z
Matrix of selected covariates to explain the overdispersion parameter

Value

A vector (inibet, inigama, inialpha) of preliminary estimates of parameter vectors for $\pi = \pi(\beta)$, $\xi=\xi(\gamma)$, $\phi=\phi(\alpha)$, respectively, of a CUBE model with covariates for all the three parameters. In details, inibet, inigama and inialpha have length equal to NCOL(Y)+1, NCOL(W)+1 and NCOL(Z)+1, respectively, to account for an intercept term for each component

See Also

inibestcube, inibestcubecsi, inibestgama

Examples

Run this code
data(relgoods)
m<-10
covpai<-relgoods[,2]
covcsi<-relgoods[,6]
covphi<-relgoods[,7]
ordinal<-relgoods[,37]
nona<-na.omit(cbind(ordinal,covpai,covcsi,covphi))  # Omitting missing values
ordinal<-nona[,1]
Y<-nona[,2]
W<-nona[,3]
Z<-nona[,4]
ini<-inibestcubecov(m, ordinal, Y, W, Z)
p<-NCOL(Y)
q<-NCOL(W)
inibet<-ini[1:(p+1)]               # Preliminary estimates for uncertainty 
inigama<-ini[(p+2):(p+q+2)]        # Preliminary estimates for feeling 
inialpha<-ini[(p+q+3):length(ini)] # Preliminary estimates for overdispersion

Run the code above in your browser using DataLab