Generate concise summary statistics for objects created by the Qval package. The output is a named list tailored to the class of the input:

CDM

contains the original call, dataset dimensions, model fit object, and attribute-pattern distribution.

validation

contains the original call, suggested Q-matrix, and original Q-matrix.

sim.data

contains the original call, dataset dimensions, and attribute-pattern distribution.

# S3 method for class 'CDM'
summary(object, ...)

# S3 method for class 'validation'
summary(object, ...)

# S3 method for class 'sim.data'
summary(object, ...)

Arguments

object

An object of class CDM, validation, or sim.data.

...

Currently unused. Additional arguments are ignored.

Value

A named list with class summary.<class> containing the components above.

Details

call

A string capturing the original function invocation.

base

A numeric vector c(N, I, K) giving the number of examinees (\(N\)), the number of items (\(I\)), and the number of attributes (\(K\)).

model.fit

(CDM only) The fitted model object returned by CDM.

patterns

(CDM and sim.data) A data.frame of frequencies (freq) and proportions (prop) of each attribute pattern.

Q.sug

(validation only) Suggested Q-matrix from validation.

Q.orig

(validation only) Original Q-matrix provided to sim.data.

Methods (by class)

  • summary(CDM): Summary method for CDM objects

  • summary(validation): Summary method for validation objects

  • summary(sim.data): Summary method for sim.data objects

Examples

set.seed(123)
library(Qval)

# \donttest{
################################################################
# Example 1: summary a CDM object                              #
################################################################
Q <- sim.Q(3, 20)
IQ <- list(P0 = runif(20, 0, 0.2), P1 = runif(20, 0.8, 1))
data.obj <- sim.data(Q, N = 500, IQ = IQ, 
                     model = "GDINA", distribute = "horder")
#> distribute =  horder 
#>  model =  GDINA 
#>  number of attributes:  3 
#>  number of items:  20 
#>  num of examinees:  500 
#>  average of P0 =  0.083 
#>  average of P1 =  0.894 
#> theta_mean =  -0.055 , theta_sd = 0.996 
#>  a =  1.5 1.5 1.5 
#>  b =  -1.5 1.5 0 
CDM.obj <- CDM(data.obj$dat, Q, model = "GDINA", method = "EM")
#> 
Iter = 1  Max. abs. change = 0.57951  Deviance  = 10238.69                                                                                  
Iter = 2  Max. abs. change = 0.09509  Deviance  = 8501.84                                                                                  
Iter = 3  Max. abs. change = 0.03995  Deviance  = 8478.24                                                                                  
Iter = 4  Max. abs. change = 0.01792  Deviance  = 8477.13                                                                                  
Iter = 5  Max. abs. change = 0.02604  Deviance  = 8477.02                                                                                  
Iter = 6  Max. abs. change = 0.01142  Deviance  = 8476.97                                                                                  
Iter = 7  Max. abs. change = 0.01740  Deviance  = 8476.96                                                                                  
Iter = 8  Max. abs. change = 0.00686  Deviance  = 8476.95                                                                                  
Iter = 9  Max. abs. change = 0.00466  Deviance  = 8476.94                                                                                  
Iter = 10  Max. abs. change = 0.00253  Deviance  = 8476.94                                                                                  
Iter = 11  Max. abs. change = 0.00030  Deviance  = 8476.94                                                                                  
Iter = 12  Max. abs. change = 0.00014  Deviance  = 8476.94                                                                                  
Iter = 13  Max. abs. change = 0.00016  Deviance  = 8476.94                                                                                  
Iter = 14  Max. abs. change = 0.00760  Deviance  = 8476.94                                                                                  
Iter = 15  Max. abs. change = 0.00246  Deviance  = 8476.94                                                                                  
Iter = 16  Max. abs. change = 0.00502  Deviance  = 8476.94                                                                                  
Iter = 17  Max. abs. change = 0.00017  Deviance  = 8476.94                                                                                  
Iter = 18  Max. abs. change = 0.00109  Deviance  = 8476.94                                                                                  
Iter = 19  Max. abs. change = 0.00004  Deviance  = 8476.94                                                                                  
summary(CDM.obj)
#> ==============================================
#>  Number of items       = 20 
#>  Number of attributes  = 3 
#>  Number of individuals = 500 
#> 
#> Model Fit:
#> Deviance     npar      AIC      BIC 
#> 8476.939   87.000 8650.939 9017.610 
#> 
#> Distribution of Alpha Patterns:
#>        000  001  010  011   100   101   110   111
#> freq    97   20  120  145     4    13    32    69
#> prop 0.194 0.04 0.24 0.29 0.008 0.026 0.064 0.138


################################################################
# Example 2: summary a validation object                       #
################################################################
MQ <- sim.MQ(Q, 0.1)
#> rate of mis-specifications =  0.1 
#>  rate of  over-specifications =  0.07 
#>  rate of under-specifications =  0.03 
CDM.obj2 <- CDM(data.obj$dat, MQ)
#> 
Iter = 1  Max. abs. change = 0.55372  Deviance  = 11376.15                                                                                  
Iter = 2  Max. abs. change = 0.20531  Deviance  = 8796.31                                                                                  
Iter = 3  Max. abs. change = 0.09493  Deviance  = 8725.28                                                                                  
Iter = 4  Max. abs. change = 0.02365  Deviance  = 8719.03                                                                                  
Iter = 5  Max. abs. change = 0.01674  Deviance  = 8718.11                                                                                  
Iter = 6  Max. abs. change = 0.01408  Deviance  = 8717.82                                                                                  
Iter = 7  Max. abs. change = 0.01043  Deviance  = 8717.68                                                                                  
Iter = 8  Max. abs. change = 0.00706  Deviance  = 8717.62                                                                                  
Iter = 9  Max. abs. change = 0.00454  Deviance  = 8717.58                                                                                  
Iter = 10  Max. abs. change = 0.00201  Deviance  = 8717.57                                                                                  
Iter = 11  Max. abs. change = 0.00717  Deviance  = 8717.56                                                                                  
Iter = 12  Max. abs. change = 0.00277  Deviance  = 8717.56                                                                                  
Iter = 13  Max. abs. change = 0.00088  Deviance  = 8717.56                                                                                  
Iter = 14  Max. abs. change = 0.00025  Deviance  = 8717.55                                                                                  
Iter = 15  Max. abs. change = 0.00016  Deviance  = 8717.55                                                                                  
Iter = 16  Max. abs. change = 0.00035  Deviance  = 8717.55                                                                                  
Iter = 17  Max. abs. change = 0.00021  Deviance  = 8717.55                                                                                  
Iter = 18  Max. abs. change = 0.00318  Deviance  = 8717.55                                                                                  
Iter = 19  Max. abs. change = 0.00007  Deviance  = 8717.55                                                                                  
val.obj <- validation(data.obj$dat, MQ, CDM.obj2, method = "GDI")
#> GDI  method with  PAA  in  test  level iteration ...
#> Iter  =  1/  1,   9 items have changed, ΔPVAF=1.04934 
summary(val.obj)
#> ==============================================
#> 
#> Suggested Q-matrix: 
#> 
#>         A1 A2 A3
#> item 1  0  1  0 
#> item 2  1  0  1 
#> item 3  1  0* 1 
#> item 4  0  0  1 
#> item 5  1* 0  1 
#> item 6  0* 0  1 
#> item 7  0  0  1 
#> item 8  0* 1  0 
#> item 9  0  0  1 
#> item 10 0* 1  1 
#> item 11 1  1  0*
#> item 12 0  1  1*
#> item 13 1  0  0 
#> item 14 0  0  1 
#> item 15 1  0* 0 
#> item 16 0  1  1 
#> item 17 1  1  1 
#> item 18 1  0  1 
#> item 19 0  1  0*
#> item 20 1  1  1 
#> Note: * denotes a modified element.


################################################################
# Example 3: summary a sim.data object                         #
################################################################
data.obj2 <- sim.data(Q = sim.Q(3, 10), N = 1000)
#> distribute =  uniform 
#>  model =  GDINA 
#>  number of attributes:  3 
#>  number of items:  10 
#>  num of examinees:  1000 
#>  average of P0 =  0.134 
#>  average of P1 =  0.865 
summary(data.obj2)
#> ==============================================
#>  Number of items       = 10 
#>  Number of attributes  = 3 
#>  Number of individuals = 1000 
#> 
#> Distribution of Alpha Patterns:
#>        000   001   010   011   100   101  110   111
#> freq   134   106   119   117   127   139  130   128
#> prop 0.134 0.106 0.119 0.117 0.127 0.139 0.13 0.128
# }