loglikihg: Log-likelihood function for IHG models

Description Usage Arguments Details See Also Examples

View source: R/loglikihg.R

Description

Compute the log-likelihood function for IHG models with or without covariates to explain the preference parameter.

Usage

1
loglikIHG(ordinal,m,param,U=0)

Arguments

ordinal

Vector of ordinal responses

m

Number of ordinal categories

param

Vector of parameters for the specified IHG model

U

Matrix of selected covariates to explain the preference parameter (default: no covariate is included in the model)

Details

If no covariate is included in the model, then param is the estimate of the preference parameter (theta), otherwise param has length equal to NCOL(U) + 1 to account for an intercept term (first entry). No missing value should be present neither for ordinal nor for U.

See Also

GEM, logLik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#### Log-likelihood of an IHG model with no covariate
m<-10; theta<-0.14; n<-300
ordinal<-simihg(n,m,theta)
loglik<-loglikIHG(ordinal,m,param=theta)
##################################
#### Log-likelihood of a IHG model with covariate 
data(relgoods)
m<-10
naord<-which(is.na(relgoods$HandWork))
nacov<-which(is.na(relgoods$Gender))
na<-union(naord,nacov)
ordinal<-relgoods$HandWork[-na]; U<-relgoods$Gender[-na]
nu<-c(-1.55,-0.11)     # first entry: intercept term
loglik<-loglikIHG(ordinal,m,param=nu,U=U); loglik

CUB documentation built on March 31, 2020, 5:14 p.m.