Skip to contents

pcirm is a partially confirmatory approach to item response models (Chen, 2020), which estimates the intercept for continuous and dichotomous data. Similar to PCFA and GPCFA, there are two major model variants with different constraints for identification. One assumes local independence (LI) with a more exploratory tendency, which can be also called the E-step. The other allows local dependence (LD) with a more confirmatory tendency, which can be also called the C-step. Parameters are obtained by sampling from the posterior distributions with the Markov chain Monte Carlo (MCMC) techniques. Different Bayesian Lasso methods are used to regularize the loading pattern and LD. The estimation results can be summarized with summary.lawbl and the factorial eigenvalue can be plotted with plot_lawbl.

Usage

pcirm(
  dat,
  Q,
  LD = TRUE,
  cati = NULL,
  PPMC = FALSE,
  burn = 5000,
  iter = 5000,
  update = 1000,
  missing = NA,
  rseed = 12345,
  sign_check = FALSE,
  sign_eps = -0.5,
  auto_stop = FALSE,
  max_conv = 10,
  digits = 4,
  alas = FALSE,
  verbose = FALSE
)

Arguments

dat

A \(N \times J\) data matrix or data.frame consisting of the responses of \(N\) individuals to \(J\) items. Only continuous and dichotomous data are supported.

Q

A \(J \times K\) design matrix for the loading pattern with \(K\) factors and \(J\) items. Elements are 1, -1, and 0 for specified, unspecified, and zero-fixed loadings, respectively. For models with LI or the E-step, one can specify a few (e.g., 2) loadings per factor. For models with LD or the C-step, the sufficient condition of one specified loading per item is suggested, although there can be a few items without any specified loading. See Examples.

LD

logical; TRUE for allowing LD (model with LD or C-step).

cati

The set of dichotomous items in sequence number (i.e., 1 to \(J\)); NULL for no and -1 for all items (default is NULL).

PPMC

logical; TRUE for conducting posterior predictive model checking.

burn

Number of burn-in iterations before posterior sampling.

iter

Number of formal iterations for posterior sampling (> 0).

update

Number of iterations to update the sampling information.

missing

Value for missing data (default is NA).

rseed

An integer for the random seed.

sign_check

logical; TRUE for checking sign switch of loading vector.

sign_eps

minimum value for switch sign of loading vector (if sign_check=TRUE).

auto_stop

logical; TRUE for enabling auto stop based on EPSR<1.1.

max_conv

maximum consecutive number of convergence for auto stop.

digits

Number of significant digits to print when printing numeric values.

alas

logical; for adaptive Lasso or not. The default is FALSE.

verbose

logical; to display the sampling information every update or not.

  • Feigen: Eigenvalue for each factor.

  • NLA_le3: Number of Loading estimates >= .3 for each factor.

  • Shrink: Shrinkage (or ave. shrinkage for each factor for adaptive Lasso).

  • EPSR & NCOV: EPSR for each factor & # of convergence.

  • Ave. Int.: Ave. item intercept.

  • LD>.2 >.1 LD>.2 >.1: # of LD terms larger than .2 and .1, and LD's shrinkage parameter.

  • #Sign_sw: Number of sign switch for each factor.

Value

pcirm returns an object of class lawbl with item intercepts. It contains a lot of information about the posteriors that can be summarized using summary.lawbl.

References

Chen, J. (2020). A partially confirmatory approach to the multidimensional item response theory with the Bayesian Lasso. Psychometrika. 85(3), 738-774. DOI:10.1007/s11336-020-09724-3.

Examples

# \donttest{
####################################
#  Example 1: Estimation with LD   #
####################################

dat <- sim24ccfa21$dat
J <- ncol(dat)
K <- 3
Q<-matrix(-1,J,K);
Q[1:8,1]<-Q[9:16,2]<-Q[17:24,3]<-1

m0 <- pcirm(dat = dat, Q = Q, LD = TRUE, cati = -1, burn = 2000,iter = 2000)
summary(m0) # summarize basic information
#> $NJK
#> [1] 1000   24    3
#> 
#> $`Miss%`
#> [1] 0
#> 
#> $`LD Allowed`
#> [1] TRUE
#> 
#> $`Burn in`
#> [1] 2000
#> 
#> $Iteration
#> [1] 2000
#> 
#> $`No. of sig lambda`
#> [1] 24
#> 
#> $Selected
#> [1] TRUE TRUE TRUE
#> 
#> $`Auto, NCONV, MCONV`
#> [1]  0  0 10
#> 
#> $EPSR
#>      Point est. Upper C.I.
#> [1,]     1.0133     1.0639
#> [2,]     1.0858     1.3328
#> [3,]     1.0049     1.0197
#> 
#> $`No. of sig LD terms`
#> [1] 7
#> 
#> $`Cat Items`
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#> 
#> $`max No. of categories`
#> [1] 2
#> 
#> $Time
#>    user  system elapsed 
#>   75.03    0.15   75.55 
#> 
summary(m0, what = 'qlambda') #summarize significant loadings in pattern/Q-matrix format
#>          1      2      3
#> I1  0.7426 0.0000 0.0000
#> I2  0.7031 0.0000 0.0000
#> I3  0.6460 0.0000 0.0000
#> I4  0.6917 0.0000 0.0000
#> I5  0.6589 0.0000 0.0000
#> I6  0.7183 0.0000 0.0000
#> I7  0.7324 0.0000 0.0000
#> I8  0.7521 0.0000 0.0000
#> I9  0.0000 0.7047 0.0000
#> I10 0.0000 0.7254 0.0000
#> I11 0.0000 0.6958 0.0000
#> I12 0.0000 0.6760 0.0000
#> I13 0.0000 0.6842 0.0000
#> I14 0.0000 0.6680 0.0000
#> I15 0.0000 0.6866 0.0000
#> I16 0.0000 0.6746 0.0000
#> I17 0.0000 0.0000 0.6891
#> I18 0.0000 0.0000 0.7132
#> I19 0.0000 0.0000 0.6953
#> I20 0.0000 0.0000 0.7237
#> I21 0.0000 0.0000 0.7092
#> I22 0.0000 0.0000 0.6939
#> I23 0.0000 0.0000 0.6976
#> I24 0.0000 0.0000 0.7576
summary(m0, what = 'offpsx') #summarize significant LD terms
#>      row col    est     sd  lower  upper sig
#> [1,]   8   7 0.1230 0.0439 0.0381 0.2126   1
#> [2,]  16  15 0.1807 0.0637 0.0433 0.2927   1
#> [3,]  23  15 0.1618 0.0531 0.0504 0.2673   1
#> [4,]  24  15 0.1420 0.0512 0.0385 0.2421   1
#> [5,]  23  16 0.1480 0.0534 0.0364 0.2506   1
#> [6,]  24  16 0.1336 0.0496 0.0393 0.2393   1
#> [7,]  24  23 0.1540 0.0516 0.0571 0.2533   1

####################################
#  Example 2: Estimation with LD   #
####################################

Q<-cbind(Q,-1);
Q[15:16,4]<-1

m1 <- pcirm(dat = dat, Q = Q, LD = FALSE, cati = -1, burn = 2000,iter = 2000)
summary(m1) # summarize basic information
#> $NJK
#> [1] 1000   24    4
#> 
#> $`Miss%`
#> [1] 0
#> 
#> $`LD Allowed`
#> [1] FALSE
#> 
#> $`Burn in`
#> [1] 2000
#> 
#> $Iteration
#> [1] 2000
#> 
#> $`No. of sig lambda`
#> [1] 28
#> 
#> $Selected
#> [1] TRUE TRUE TRUE TRUE
#> 
#> $`Auto, NCONV, MCONV`
#> [1]  0  0 10
#> 
#> $EPSR
#>      Point est. Upper C.I.
#> [1,]     1.0270     1.1205
#> [2,]     1.0927     1.3546
#> [3,]     1.0622     1.1633
#> [4,]     1.0002     1.0010
#> 
#> $`Cat Items`
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#> 
#> $`max No. of categories`
#> [1] 2
#> 
#> $Time
#>    user  system elapsed 
#>   46.20    0.10   46.55 
#> 
summary(m1, what = 'qlambda') #summarize significant loadings in pattern/Q-matrix format
#>          1      2      3      4
#> I1  0.7293 0.0000 0.0000 0.0000
#> I2  0.6933 0.0000 0.0000 0.0000
#> I3  0.6375 0.0000 0.0000 0.0000
#> I4  0.6896 0.0000 0.0000 0.0000
#> I5  0.6585 0.0000 0.0000 0.0000
#> I6  0.7073 0.0000 0.0000 0.0000
#> I7  0.8222 0.0000 0.0000 0.0000
#> I8  0.8333 0.0000 0.0000 0.0000
#> I9  0.0000 0.7155 0.0000 0.0000
#> I10 0.0000 0.7363 0.0000 0.0000
#> I11 0.0000 0.7253 0.0000 0.0000
#> I12 0.0000 0.7116 0.0000 0.0000
#> I13 0.0000 0.6982 0.0000 0.0000
#> I14 0.0000 0.6939 0.0000 0.0000
#> I15 0.0000 0.6868 0.0000 0.5954
#> I16 0.0000 0.6629 0.0000 0.5705
#> I17 0.0000 0.0000 0.6969 0.0000
#> I18 0.0000 0.0000 0.7431 0.0000
#> I19 0.0000 0.0000 0.7027 0.0000
#> I20 0.0000 0.0000 0.7418 0.0000
#> I21 0.0000 0.0000 0.7219 0.0000
#> I22 0.0000 0.0000 0.7068 0.0000
#> I23 0.0000 0.0000 0.6662 0.4724
#> I24 0.0000 0.0000 0.7286 0.4335
summary(m1, what = 'offpsx') #summarize significant LD terms
#> NULL
# }