Learn R Programming

CUB (version 0.1)

inibestcubecsi: Preliminary estimates of parameters for CUBE models with covariates only for feeling

Description

Compute preliminary parameter estimates of a CUBE model with covariates only for feeling, given ordinal responses. These estimates are set as initial values to start the E-M algorithm for such model.

Usage

inibestcubecsi(m, ordinal, W, starting, maxiter, toler)

Arguments

m
Number of ordinal categories
ordinal
Vector of ordinal responses
W
Matrix of selected covariates to explain the feeling parameter
starting
Starting values for cubeforsim simulation routine
maxiter
Maximum number of iterations allowed for running the cubeforsim simulation routine
toler
Fixed error tolerance for final estimates for cubeforsim simulation routine

Value

A vector (pai, gamaest, phi), where pai is the initial estimate for the uncertainty parameter, gamaest is the vector of initial estimates for the feeling component (including an intercept term in the first entry), and phi is the initial estimate for the overdispersion parameter

Details

It invokes cubeforsim to obtain preliminary estimates for the uncertainty and the overdispersion parameters. As to the feeling component, it considers the nested CUB model with covariates and calls inibestgama to derive initial estimates for the coefficients of the selected covariates.

See Also

inibestcube, inibestcubecov, inibestgama, cubeforsim

Examples

Run this code
data(relgoods)
isnacov<-which(is.na(relgoods[,2]))
isnaord<-which(is.na(relgoods[,37]))
unina<-union(isnacov,isnaord)
newdati<-relgoods[-unina,]
ordinal<-newdati[,37]
W<-newdati[,2]
m<-10
starting<-rep(0.1, 3)
ini<-inibestcubecsi(m, ordinal, W, starting, maxiter=100, toler=1e-3)
nparam<-length(ini)
pai<-ini[1]                 # Preliminary estimates for uncertainty component
gamaest<-ini[2:(nparam-1)]  # Preliminary estimates for coefficients of feeling covariates
phi<-ini[nparam]            # Preliminary estimates for overdispersion component

Run the code above in your browser using DataLab