M2.Factor {FactorCopula} | R Documentation |
Goodness-of-fit of factor copula models for mixed data
Description
The limited information M_2
statistic (Maydeu-Olivares and Joe, 2006) of factor copula models for mixed continuous and discrete data.
Usage
M2.1F(tcontinuous, ordinal, tcount, cpar, copF1, gl)
M2.2F(tcontinuous, ordinal, tcount, cpar, copF1, copF2, gl, SpC)
Arguments
tcontinuous |
|
ordinal |
|
tcount |
|
cpar |
A list of estimated copula parameters. |
copF1 |
|
copF2 |
|
gl |
Gauss legendre quardrature nodes and weights. |
SpC |
Special case for the 2-factor copula model with BVN copulas. Select a bivariate copula at the 2nd factor to be fixed to independence. e.g. "SpC = 1" to set the first copula at the 2nd factor to independence. |
Details
The M_2
statistic has been developed for goodness-of-fit testing in multidimensional contingency tables by Maydeu-Olivares and Joe (2006).
Nikoloulopoulos and Joe (2015) have used the M_2
statistic to assess the goodness-of-fit of factor copula models for ordinal data. We build on the aforementioned papers and propose a methodology to assess the overall goodness-of-fit of factor copula models for mixed continuous and discrete responses. Since the M_2
statistic has been developed for multivariate ordinal data, we propose to first transform the continuous and count variables to ordinal and then calculate the M_2
statistic at the maximum likelihood estimate before transformation.
Value
A list containing the following components:
M2 |
The |
df |
|
p-value |
The resultant |
Author(s)
Sayed H. Kadhem s.kadhem@uea.ac.uk
Aristidis K. Nikoloulopoulos a.nikoloulopoulos@uea.ac.uk
References
Kadhem, S.H. and Nikoloulopoulos, A.K. (2021) Factor copula models for mixed data. British Journal of Mathematical and Statistical Psychology, 74, 365–403. doi:10.1111/bmsp.12231.
Maydeu-Olivares, A. and Joe, H. (2006). Limited information goodness-of-fit testing in multidimensional contingency tables. Psychometrika, 71, 713–732. doi:10.1007/s11336-005-1295-9.
Nikoloulopoulos, A.K. and Joe, H. (2015) Factor copula models with item response data. Psychometrika, 80, 126–150. doi:10.1007/s11336-013-9387-4.
Examples
#------------------------------------------------
# Setting quadreture points
nq <- 25
gl <- gauss.quad.prob(nq)
#------------------------------------------------
# PE Data
#------------------ -----------------
data(PE)
continuous.PE1 = -PE[,1]
continuous.PE2 = PE[,2]
continuous.PE <- cbind(continuous.PE1, continuous.PE2)
categorical.PE <- PE[, 3:5]
#------------------------------------------------
# Estimation
#------------------ -----------------
#------------------ One-factor -----------------
# one-factor copula model
cop1f.PE <- c("joe", "joe", "rjoe", "joe", "gum")
est1factor.PE <- mle1factor(continuous.PE, categorical.PE,
count=NULL, copF1=cop1f.PE, gl, hessian = TRUE)
#------------------------------------------------
# M2
#------------------------------------------------
#Transforming the continuous to ordinal data:
ncontinuous.PE = continuous2ordinal(continuous.PE, 5)
# M2 statistic for the one-factor copula model:
m2.1f.PE <- M2.1F(ncontinuous.PE, categorical.PE, tcount=NULL,
cpar=est1factor.PE$cpar, copF1=cop1f.PE, gl)