logscore {CUB}R Documentation

Logarithmic score

Description

Compute the logarithmic score of a CUB model with covariates both for the uncertainty and the feeling parameters.

Usage

logscore(m,ordinal,Y,W,bet,gama)

Arguments

m

Number of ordinal categories

ordinal

Vector of ordinal responses

Y

Matrix of covariates for explaining the uncertainty component

W

Matrix of covariates for explaining the feeling component

bet

Vector of parameters for the uncertainty component, with length NCOL(Y)+1 to account for an intercept term (first entry of bet)

gama

Vector of parameters for the feeling component, with length NCOL(W)+1 to account for an intercept term (first entry of gama)

Details

No missing value should be present neither for ordinal nor for covariate matrices: thus, deletion or imputation procedures should be preliminarily run.

References

Tutz, G. (2012). Regression for Categorical Data, Cambridge University Press, Cambridge

Examples

data(relgoods)
m<-10
naord<-which(is.na(relgoods$Walking))
nacovpai<-which(is.na(relgoods$Gender))
nacovcsi<-which(is.na(relgoods$Smoking))
na<-union(naord,union(nacovpai,nacovcsi))
ordinal<-relgoods$Walking[-na]
Y<-relgoods$Gender[-na]
W<-relgoods$Smoking[-na]
bet<-c(-0.45,-0.48)
gama<-c(-0.55,-0.43)
logscore(m,ordinal,Y=Y,W=W,bet,gama)

[Package CUB version 1.1.4 Index]