estQ {cdmTools}R Documentation

Empirical Q-matrix estimation

Description

Empirical Q-matrix estimation based on the discrete factor loading method (Wang, Song, & Ding, 2018) as used in Nájera, Abad, and Sorrel (2021). Apart from the conventional dichotomization criteria, the procedure based on loading differences described in Garcia-Garzon, Abad, and Garrido (2018) is also available. Furthermore, the bagging bootstrap implementation (Xu & Shang, 2018) can be applied; it is recommended when working with small sample sizes. The psych package (Revelle, 2020) is used for estimating the required exploratory factor analysis (EFA).

Usage

estQ(
  r,
  K,
  n.obs = NULL,
  criterion = "row",
  boot = FALSE,
  efa.args = list(cor = "tet", rotation = "oblimin", fm = "uls"),
  boot.args = list(N = 0.8, R = 100, verbose = TRUE, seed = NULL)
)

Arguments

r

A correlation matrix or raw data (matrix or data.frame). If a correlation matrix is used, it must have dimensions J items × J items. Please note that tetrachoric or polychoric correlations should be used when working with dichotomous or polytomous items, respectively. If raw data is used, it must have dimensions N individuals × J items. Missing values need to be coded as NA.

K

Number of attributes to use.

n.obs

Number of individuals if r is a correlation matrix. If n.obs is provided, r will be treated as a correlation matrix. Use NULL if r is raw data. The default is NULL.

criterion

Dichotomization criterion to transform the factor loading matrix into the Q-matrix. The possible options include "row" (for row means), "col" (for column means), "loaddiff" (for the procedure based on loading differences), or a value between 0 and 1 (for a specific threshold). The default is "row".

boot

Apply the bagging bootstrap implementation? Only available if r is raw data. If FALSE, the EFA will be applied once using the whole sample size. If TRUE, several EFAs will be applied with different subsamples; the estimated Q-matrix will be dichotomized from the bootstrapped Q-matrix, but the EFA fit indices, factor loadings, and communalities will be computed from the EFA with the whole sample size. The default is FALSE.

efa.args

A list of arguments for the EFA estimation:

cor

Type of correlations to use. It includes "cor" (for Pearson correlations) and "tet" (for tetrachoric/polychoric correlations), among others. See fa function from the psych R package for additional details. The default is "tet".

rotation

Rotation procedure to use. It includes "oblimin", "varimax", and "promax", among others. An oblique rotation procedure is usually recommended. See fa function from the psych R package for additional details. The default is "oblimin".

fm

Factoring method to use. It includes "uls" (for unweighted least squares), "ml" (for maximum likelihood), and "wls" (for weighted least squares), among others. See fa function from the psych R package for additional details. The default is "uls".

boot.args

A list of arguments for the bagging bootstrap implementation (ignored if boot = FALSE):

N

Sample size (or proportion of the total sample size, if lower than 1) to use in each bootstrap replication. The default is .8.

R

Number of bootstrap replications. The default is 100.

verbose

Show progress? The default is TRUE.

seed

A seed for obtaining consistent results. If NULL, no seed is used. The default is NULL.

Value

estQ returns an object of class estQ.

est.Q

Estimated Q-matrix (matrix).

efa.loads

Factor loading matrix (matrix).

efa.comm

EFA communalities (vector).

efa.fit

EFA model fit indices (vector).

boot.Q

Bagging bootstrap Q-matrix before dichotomization. Only if boot = TRUE (matrix).

is.Qid

Q-matrix identifiability information (list).

specifications

Function call specifications (list).

Author(s)

Pablo Nájera, Universidad Pontificia Comillas

References

Garcia-Garzon, E., Abad, F. J., & Garrido, L. E. (2018). Improving bi-factor exploratory modelling: Empirical target rotation based on loading differences. Methodology, 15, 45–55. https://doi.org/10.1027/1614-2241/a000163

Nájera, P., Abad, F. J., & Sorrel, M. A. (2021). Determining the number of attributes in cognitive diagnosis modeling. Frontiers in Psychology, 12:614470. https://doi.org/10.3389/fpsyg.2021.614470

Revelle, W. (2019). psych: Procedures for Psychological, Psychometric, and Personality Research. R package version 1.9.12. https://CRAN.R-project.org/package=psych.

Wang, W., Song, L., & Ding, S. (2018). An exploratory discrete factor loading method for Q-matrix specification in cognitive diagnosis models. In: M. Wilberg, S. Culpepper, R. Janssen, J. Gonzalez, & D. Molenaar (Eds.), Quantitative Psychology. IMPS 2017. Springer Proceedings in Mathematics & Statistics (Vol. 233, pp. 351–362). Springer.

Xu, G., & Shang, Z. (2018). Identifying latent structures in restricted latent class models. Journal of the American Statistical Association, 113, 1284–1295. https://doi.org/10.1080/01621459.2017.1340889

Examples

library(GDINA)
dat <- sim30GDINA$simdat
Q <- sim30GDINA$simQ

#------------------------------
# Using default specifications
#------------------------------
sugQ1 <- estQ(r = dat, K = 5) # Estimate Q-matrix
sugQ1$est.Q <- orderQ(sugQ1$est.Q, Q)$order.Q # Reorder Q-matrix attributes
mean(sugQ1$est.Q == Q) # Check similarity with the generating Q-matrix

#------------------------------------
# Using the bagging bootstrap method
#------------------------------------
# In boot.args argument, R >= 100 is recommended (R = 20 is here used for illustration purposes)
sugQ2 <- estQ(r = dat, K = 5, boot = TRUE, boot.args = list(R = 20, seed = 123)) # Estimate Q-matrix
sugQ2$est.Q <- orderQ(sugQ2$est.Q, Q)$order.Q # Reorder Q-matrix attributes
sugQ2$boot.Q # Proportion of replicas a q-entry was specified in the estimated Q-matrix
mean(sugQ2$est.Q == Q) # Check similarity with the generating Q-matrix

[Package cdmTools version 1.0.5 Index]