Learn R Programming

FactorCopula (version 0.9.3)

M2.StructuredFactor: Goodness-of-fit of bi-factor and second-order copula models for item response data

Description

The limited information \(M_2\) statistic (Maydeu-Olivares and Joe, 2006) of bi-factor and second-order copula models for item response data.

Usage

M2Bifactor(y,cpar, copnames1, copnames2, gl, ngrp, grpsize)
M2Second_order(y,cpar, copnames1, copnames2, gl, ngrp, grpsize)

Value

A list containing the following components:

M2

The \(M_2\) statistic which has a null asymptotic distribution that is \(\chi^2\) with \(s-q\) degrees of freedom, where \(s\) is the number of univariate and bivariate margins that do not include the category 0 and \(q\) is the number of model parameters.

df

\(s-q\).

p-value

The resultant \(p\)-value.

Arguments

y

\(n \times d\) matrix with the ordinal reponse data, where \(n\) and \(d\) is the number of observations and variables, respectively.

cpar

A list of estimated copula parameters.

copnames1

For the bi-factor copula: \(d\)-vector with the names of bivariate copulas that link each of the oberved variabels with the common factor. For the second-order factor copula: \(G\)-vector with the names of bivariate copulas that link the each of the group-specific factors with the common factor, where \(G\) is the number of groups of items. Choices are “bvn” for BVN, “bvt\(\nu\)” with \(\nu = \{2, \ldots, 9\}\) degrees of freedom for t-copula, “frk” for Frank, “gum” for Gumbel, “rgum” for reflected Gumbel, “1rgum” for 1-reflected Gumbel, “2rgum” for 2-reflected Gumbel.

copnames2

For the bi-factor copula: \(d\)-vector with the names of bivariate copulas that link the each of the oberved variabels with the group-specific factor. For the second-order factor copula: \(d\)-vector with the names of bivariate copulas that link the each of the oberved variabels with the group-specific factor. Choices are “bvn” for BVN, “bvt\(\nu\)” with \(\nu = \{2, \ldots, 9\}\) degrees of freedom for t-copula, “frk” for Frank, “gum” for Gumbel, “rgum” for reflected Gumbel, “1rgum” for 1-reflected Gumbel, “2rgum” for 2-reflected Gumbel.

gl

Gauss legendre quardrature nodes and weights.

ngrp

number of non-overlapping groups.

grpsize

vector indicating the size for each group, e.g., c(4,4,4) indicating four items in all three groups.

Author

Sayed H. Kadhem s.kadhem@uea.ac.uk
Aristidis K. Nikoloulopoulos a.nikoloulopoulos@uea.ac.uk

Details

The \(M_2\) statistic has been developed for goodness-of-fit testing in multidimensional contingency tables by Maydeu-Olivares and Joe (2006). We use the \(M_2\) to assess the overall fit for the bi-factor and second-order copula models for item resposne data (Kadhem & Nikoloulopoulos, 2021).

References

Kadhem, S.H. and Nikoloulopoulos, A.K. (2023) Bi-factor and second-order copula models for item response data. Psychometrika, 88, 132--157. tools:::Rd_expr_doi("doi:10.1007/s11336-022-09894-2").

Maydeu-Olivares, A. and Joe, H. (2006). Limited information goodness-of-fit testing in multidimensional contingency tables. Psychometrika, 71, 713--732. tools:::Rd_expr_doi("10.1007/s11336-005-1295-9").

Examples

Run this code
# \donttest{
#------------------------------------------------
# Setting quadreture points
nq <- 15
gl <- gauss.quad.prob(nq)
#------------------------------------------------
#                     TAS Data
#------------------             -----------------
data(TAS)
#using a subset of the data
#group1: 1,3,6,7,9,13,14
grp1=c(1,3,6)
#group2: 2,4,11,12,17
grp2=c(2,4,11)
#group3: 5,8,10,15,16,18,19,20
grp3=c(5,8,10)
#Rearrange items within testlets
set.seed(123)
i=sample(1:nrow(TAS),500)
ydat=TAS[i,c(grp1,grp2,grp3)]

d=ncol(ydat);d
n=nrow(ydat);n

#size of each group
g1=length(grp1)
g2=length(grp2)
g3=length(grp3)

grpsize=c(g1,g2,g3)#group size
#number of groups
ngrp=length(grpsize)

#------------------------------------------------
#                       M2
#------------------------------------------------
#BI-FACTOR
tauX0 = c(0.49,0.16,0.29,#0.09,0.47,0.49,0.30,
          0.46,0.41,0.33,#0.29,0.24,
          0.10,0.16,0.14)#,0.12,0.03,0.03,0.10,0.10)
tauXg = c(0.09,0.37,0.23,#0.53,0.24,0.32,0.27,
          0.53,0.58,0.20,#0.23,0.25,0.34,0.33,
          0.30,0.19,0.24)#,0.29,0.43,0.26)
copX0 = rep("bvt2", d)
copXg = c(rep("rgum", g1), rep("bvt3", g2+g3))
#converting taus to cpars
cparX0=mapply(function(x,y) tau2par(x,y),x=copX0,y=tauX0)
cparXg=mapply(function(x,y) tau2par(x,y),x=copXg,y=tauXg)
cpar=c(cparX0,cparXg)

m2_Bifactor = M2Bifactor(y=ydat, cpar, copX0, copXg, gl, ngrp, grpsize)

# }

Run the code above in your browser using DataLab