print.RdPrint concise, user-friendly summaries of objects generated by the Qval package.
Supports objects of classes CDM, validation, sim.data,
fit, is.Qident, att.hierarchy,
as well as their corresponding summary objects.
# S3 method for class 'CDM'
print(x, ...)
# S3 method for class 'validation'
print(x, ...)
# S3 method for class 'sim.data'
print(x, ...)
# S3 method for class 'fit'
print(x, ...)
# S3 method for class 'is.Qident'
print(x, ...)
# S3 method for class 'att.hierarchy'
print(x, ...)
# S3 method for class 'summary.CDM'
print(x, ...)
# S3 method for class 'summary.validation'
print(x, ...)
# S3 method for class 'summary.sim.data'
print(x, ...)
# S3 method for class 'summary.fit'
print(x, ...)
# S3 method for class 'summary.is.Qident'
print(x, ...)
# S3 method for class 'summary.att.hierarchy'
print(x, ...)An object of the appropriate class (e.g., CDM,
validation, sim.data,
fit, is.Qident,
att.hierarchy, or their summaries).
Currently unused. Additional arguments are ignored.
Invisibly returns x.
The print methods provide an at-a-glance view of key information:
print.CDMdisplays sample size, item and attribute counts, and package information.
print.validationshows suggested modifications to the Q-matrix, marking changed entries with an asterisk.
print.sim.datareports dimensions of simulated data and offers guidance on extraction.
print.fitshow basic fit indices.
print.is.Qidentprints basic results from is.Qident.
print.att.hierarchyprints basic results from att.hierarchy.
print.summary.CDMprints fitted model details and alpha-pattern distribution from a summary.CDM object.
print.summary.validationprints suggested Q-matrix changes or a message if none are recommended.
print.summary.sim.dataprints attribute-pattern frequencies and proportions from summary.sim.data.
print.summary.fitprints basic fit indices from summary.fit.
print.summary.is.Qidentprints basic results from summary.is.Qident.
print.summary.att.hierarchyprints basic results from summary.att.hierarchy.
print(CDM): Print method for CDM objects
print(validation): Print method for validation objects
print(sim.data): Print method for sim.data objects
print(fit): Print method for fit objects
print(is.Qident): Print method for is.Qident objects
print(att.hierarchy): Print method for att.hierarchy objects
print(summary.CDM): Print method for summary.CDM objects
print(summary.validation): Print method for summary.validation objects
print(summary.sim.data): Print method for summary.sim.data objects
print(summary.fit): Print method for summary.fit objects
print(summary.is.Qident): Print method for summary.is.Qident objects
print(summary.att.hierarchy): Print method for summary.att.hierarchy objects
set.seed(123)
library(Qval)
# \donttest{
################################################################
# Example 1: print a CDM object #
################################################################
Q <- sim.Q(3, 20)
IQ <- list(P0 = runif(20, 0.0, 0.2), P1 = runif(20, 0.8, 1.0))
data.obj <- sim.data(Q = 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", maxitr = 2000, verbose = 1)
#>
Iter = 1 Max. abs. change = 0.58226 Deviance = 10238.69
Iter = 2 Max. abs. change = 0.09628 Deviance = 8499.25
Iter = 3 Max. abs. change = 0.03447 Deviance = 8474.14
Iter = 4 Max. abs. change = 0.01418 Deviance = 8473.11
Iter = 5 Max. abs. change = 0.01087 Deviance = 8473.00
Iter = 6 Max. abs. change = 0.00870 Deviance = 8472.98
Iter = 7 Max. abs. change = 0.00678 Deviance = 8472.96
Iter = 8 Max. abs. change = 0.00521 Deviance = 8472.96
Iter = 9 Max. abs. change = 0.00398 Deviance = 8472.95
Iter = 10 Max. abs. change = 0.00303 Deviance = 8472.95
Iter = 11 Max. abs. change = 0.00230 Deviance = 8472.95
Iter = 12 Max. abs. change = 0.00174 Deviance = 8472.95
Iter = 13 Max. abs. change = 0.00131 Deviance = 8472.95
Iter = 14 Max. abs. change = 0.00099 Deviance = 8472.95
Iter = 15 Max. abs. change = 0.00075 Deviance = 8472.95
Iter = 16 Max. abs. change = 0.00056 Deviance = 8472.95
Iter = 17 Max. abs. change = 0.00042 Deviance = 8472.95
Iter = 18 Max. abs. change = 0.00032 Deviance = 8472.95
Iter = 19 Max. abs. change = 0.00024 Deviance = 8472.95
Iter = 20 Max. abs. change = 0.00018 Deviance = 8472.95
Iter = 21 Max. abs. change = 0.00014 Deviance = 8472.95
Iter = 22 Max. abs. change = 0.00010 Deviance = 8472.95
Iter = 23 Max. abs. change = 0.00008 Deviance = 8472.95
print(CDM.obj)
#> Qval version 1.2.4 (2025-11-20)
#> ==============================================
#> Number of items = 20
#> Number of attributes = 3
#> Number of individuals = 500
#> To extract components, use the method extract.
################################################################
# Example 2: print a validation object #
################################################################
set.seed(123)
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.obj <- CDM(data.obj$dat, MQ)
#>
Iter = 1 Max. abs. change = 0.47926 Deviance = 11325.04
Iter = 2 Max. abs. change = 0.15872 Deviance = 9165.19
Iter = 3 Max. abs. change = 0.09367 Deviance = 9090.64
Iter = 4 Max. abs. change = 0.02416 Deviance = 9083.93
Iter = 5 Max. abs. change = 0.01088 Deviance = 9083.21
Iter = 6 Max. abs. change = 0.00710 Deviance = 9083.10
Iter = 7 Max. abs. change = 0.00481 Deviance = 9083.07
Iter = 8 Max. abs. change = 0.00332 Deviance = 9083.06
Iter = 9 Max. abs. change = 0.00232 Deviance = 9083.05
Iter = 10 Max. abs. change = 0.00164 Deviance = 9083.05
Iter = 11 Max. abs. change = 0.00117 Deviance = 9083.05
Iter = 12 Max. abs. change = 0.00083 Deviance = 9083.05
Iter = 13 Max. abs. change = 0.00060 Deviance = 9083.05
Iter = 14 Max. abs. change = 0.00043 Deviance = 9083.05
Iter = 15 Max. abs. change = 0.00031 Deviance = 9083.05
Iter = 16 Max. abs. change = 0.00022 Deviance = 9083.05
Iter = 17 Max. abs. change = 0.00016 Deviance = 9083.05
Iter = 18 Max. abs. change = 0.00012 Deviance = 9083.05
Iter = 19 Max. abs. change = 0.00009 Deviance = 9083.05
validation.obj <- validation(data.obj$dat, MQ, CDM.obj,
method = "GDI")
#> GDI method with PAA in test level iteration ...
#> Iter = 1/ 1, 6 items have changed, ΔPVAF=1.36732
print(validation.obj)
#> Qval version 1.2.4 (2025-11-20)
#> ==============================================
#>
#> 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: print a sim.data object #
################################################################
set.seed(123)
Q2 <- sim.Q(3, 10)
data.obj2 <- sim.data(Q = Q2, N = 1000)
#> distribute = uniform
#> model = GDINA
#> number of attributes: 3
#> number of items: 10
#> num of examinees: 1000
#> average of P0 = 0.174
#> average of P1 = 0.889
print(data.obj2)
#> Qval version 1.2.4 (2025-11-20)
#> ==============================================
#> Number of items = 10
#> Number of attributes = 3
#> Number of individuals = 1000
#> To extract components, use the method extract.
################################################################
# Example 4: print a fit object #
################################################################
set.seed(123)
Q2 <- sim.Q(3, 10)
fit.obj <- fit(Y = data.obj$dat, Q = Q, model = "GDINA")
#>
Iter = 1 Max. abs. change = 0.58226 Deviance = 10238.69
Iter = 2 Max. abs. change = 0.09628 Deviance = 8499.25
Iter = 3 Max. abs. change = 0.03447 Deviance = 8474.14
Iter = 4 Max. abs. change = 0.01418 Deviance = 8473.11
Iter = 5 Max. abs. change = 0.01087 Deviance = 8473.00
Iter = 6 Max. abs. change = 0.00870 Deviance = 8472.98
Iter = 7 Max. abs. change = 0.00678 Deviance = 8472.96
Iter = 8 Max. abs. change = 0.00521 Deviance = 8472.96
Iter = 9 Max. abs. change = 0.00398 Deviance = 8472.95
Iter = 10 Max. abs. change = 0.00303 Deviance = 8472.95
Iter = 11 Max. abs. change = 0.00230 Deviance = 8472.95
Iter = 12 Max. abs. change = 0.00174 Deviance = 8472.95
Iter = 13 Max. abs. change = 0.00131 Deviance = 8472.95
Iter = 14 Max. abs. change = 0.00099 Deviance = 8472.95
Iter = 15 Max. abs. change = 0.00075 Deviance = 8472.95
Iter = 16 Max. abs. change = 0.00056 Deviance = 8472.95
Iter = 17 Max. abs. change = 0.00042 Deviance = 8472.95
Iter = 18 Max. abs. change = 0.00032 Deviance = 8472.95
Iter = 19 Max. abs. change = 0.00024 Deviance = 8472.95
Iter = 20 Max. abs. change = 0.00018 Deviance = 8472.95
Iter = 21 Max. abs. change = 0.00014 Deviance = 8472.95
Iter = 22 Max. abs. change = 0.00010 Deviance = 8472.95
Iter = 23 Max. abs. change = 0.00008 Deviance = 8472.95
print(fit.obj)
#> Qval version 1.2.4 (2025-11-20)
#> ==============================================
#> Number of parameters = 87
#>
#> Relative fit indices = :
#> -2LL AIC BIC CAIC SABIC
#> 8472.948 8646.948 9013.619 9100.619 8737.475
#>
#> Absolute fit indices = :
#> M2 df p.value RMSEA2 SRMSR
#> 126.958 123.000 0.385 0.008 0.028
################################################################
# Example 5: print summary objects #
################################################################
summary.CDM.obj <- summary(CDM.obj)
print(summary.CDM.obj)
#> ==============================================
#> Number of items = 20
#> Number of attributes = 3
#> Number of individuals = 500
#>
#> Model Fit:
#> Deviance npar AIC BIC
#> 9083.045 89.000 9261.045 9636.145
#>
#> Distribution of Alpha Patterns:
#> 000 001 010 011 100 101 110 111
#> freq 96 17 124 135 4 15 33 76
#> prop 0.192 0.034 0.248 0.27 0.008 0.03 0.066 0.152
summary.val.obj <- summary(validation.obj)
print(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.
summary.sim.obj <- summary(data.obj2)
print(summary.sim.obj)
#> ==============================================
#> 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 126 116 118 137 130 119 121 133
#> prop 0.126 0.116 0.118 0.137 0.13 0.119 0.121 0.133
summary.fit <- summary(fit.obj)
print(summary.fit)
#> ==============================================
#> Number of parameters = 87
#>
#> Relative fit indices = :
#> -2LL AIC BIC CAIC SABIC
#> 8472.948 8646.948 9013.619 9100.619 8737.475
#>
#> Absolute fit indices = :
#> M2 df p.value RMSEA2 SRMSR
#> 126.958 123.000 0.385 0.008 0.028
# }