1 Preparation of R and data

1.1 Load data and NEPSroutines

load("ex4.rda")
resp <- ex4$resp
vars <- ex4$vars

library("NEPSroutines")

1.2 User-defined missing values

table(unlist(resp[vars$item]))
## 
##    -54    -55    -56    -94    -95    -97      0      1      2      3      4 
## 239325     81   1280  32427   2269   5651  53828  51180  15325  12927   5706 
##      5      6      a      b      c      d      e      f 
##   3790   3222  14496   9436  10401   5398   6973   1165
mvs = c(
  OM = -97,
  NV = -95,
  NR = -94,
  NP = -56,
  ND = -55,
  MD = -54
)

labels_mvs = c(
  ALL = "total missing items",
  OM = "omitted items",
  NV = "not valid items",
  NR = "not reached items",
  NP = "not participated",
  ND = "not determinable items",
  MD = "items missing by design"
)

1.3 Attributes for socio-demographic variables

# Sex
attributes(resp$sex)$labels <- c(
  female = 0,
  male = 1
)

# Books
attributes(resp$books)$labels <- c(
  less_than_100 = 0,
  more_than_100 = 1
)

2 Sample and Booklet Descriptives

# Sample size with only valid cases
NEPSroutines::n_valid(resp, valid = "valid")
## There are 3700 valid cases and 10 invalid cases in the dataset.
# Descriptives (mean, sd, etc.) of continuous variables
NEPSroutines::desc_con(resp, desc = "age", valid = "valid")
## 
## Summary statistics of the continuous variables:
##        n   mean    sd median    min    max
## age 3700 45.024 0.925  45.03 43.115 46.948
# Descriptives (attributes, frequency) of nominal socio-demographic variables
NEPSroutines::show_attributes(resp, desc = c("sex", "books"))
## 
## The attributes for variable sex are:
## female   male 
##      0      1
## 
## The attributes for variable books are:
## less_than_100 more_than_100 
##             0             1
NEPSroutines::desc_nom(resp, desc = c("sex", "books"), valid = "valid")
## 
## Sample size by groups:
##       sex books
## 0    1872  1814
## 1    1828  1886
## <NA>    0     0
## 
## Frequency of groups including missing values:
##      sex      books   
## [1,] "50.59%" "49.03%"
## [2,] "49.41%" "50.97%"
## [3,] "0%"     "0%"
## 
## Frequency of groups excluding missing values:
##      sex      books   
## [1,] "50.59%" "49.03%"
## [2,] "49.41%" "50.97%"

3 Missing Responses Analyses

3.1 Missing Responses by Person

max(vars$pos[vars$stage1])
## [1] 6
max(vars$pos[vars$stage2])
## [1] 12
max(vars$pos[vars$stage3])
## [1] 18
NEPSroutines::mv_person(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  stages = c(stage1 = 6, stage2 = 12, stage3 = 18),
  mvs = mvs,
  labels_mvs = labels_mvs,
  missing_by_design = c(-54,-56),
  show_all = TRUE,
  overwrite = TRUE,
  plots = TRUE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables",
  path_plots = "plots/missings_by_person",
  digits = 2,
  warn = TRUE,
  verbose = FALSE
)
## 
## Table with results:
##          OM   NV    NR   ND   ALL
## mean   0.45 0.16  2.43 0.02  3.07
## sd     0.67 0.40  2.99 0.15  2.97
## median 0.00 0.00  1.00 0.00  2.00
## min    0.00 0.00  0.00 0.00  0.00
## max    4.00 3.00 16.00 1.00 17.00
## 

3.2 Missing Responses by Item

resp$stage1 <- rowSums(resp[,vars$item[vars$stage1 & !vars$raw]] >= 0) > 0
resp$stage2 <- rowSums(resp[,vars$item[vars$stage2 & !vars$raw]] >= 0) > 0
resp$stage3 <- rowSums(resp[,vars$item[vars$stage3 & !vars$raw]] >= 0) > 0
table(resp$stage2,resp$stage3)
##        
##         FALSE TRUE
##   FALSE    89    0
##   TRUE    402 3219
NEPSroutines::mv_item(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  position = "pos",
  stages = c("stage1", "stage2", "stage3"),
  mvs = mvs,
  labels_mvs = labels_mvs,
  missing_by_design = c(-54,-56),
  overwrite = TRUE,
  plots = TRUE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables",
  path_plots = "plots/missings_by_item",
  digits = 2,
  warn = TRUE,
  verbose = FALSE
)
## 
## Table 1 shows missing values by item position and missing type.
## All other tables show summary statistics over all items.
## $list
##           item position N_administered N_valid   OM   NV    NR   ND   ALL
## 4  sca140040_c        1           3700    3558 2.70 1.14  0.00 0.00  3.84
## 12 sca140120_c        2           3700    3544 3.05 1.16  0.00 0.00  4.22
## 7  sca140070_c        3           1853    1761 3.35 0.65  0.97 0.00  4.96
## 13 sca14013s_c        3           1847    1782 2.27 0.92  0.32 0.00  3.52
## 10 sca140100_c        4           1853    1756 3.18 0.92  1.13 0.00  5.23
## 23 sca140230_c        4           1847    1774 2.33 1.14  0.49 0.00  3.95
## 15 sca140150_c        5           1853    1750 3.29 0.81  1.46 0.00  5.56
## 29 sca140290_c        5           1847    1751 3.14 1.08  0.97 0.00  5.20
## 28 sca14028s_c        6           1853    1735 3.40 1.40  1.57 0.00  6.37
## 32 sca140320_c        6           1847    1740 3.14 1.25  1.41 0.00  5.79
## 9  sca140090_c        7           3700    3473 3.08 0.92  2.14 0.00  6.14
## 22 sca140220_c        8           3700    3467 2.43 1.03  2.84 0.00  6.30
## 2  sca14002s_c        9           1847    1639 2.06 0.92  3.90 4.39 11.26
## 6  sca140060_c        9           1853    1712 2.81 1.13  3.67 0.00  7.61
## 3  sca14003s_c       10           1847    1677 2.54 1.08  5.58 0.00  9.20
## 11 sca14011s_c       10           1853    1678 3.40 0.92  5.13 0.00  9.44
## 17 sca140170_c       11           1853    1661 2.37 0.81  7.18 0.00 10.36
## 20 sca14020s_c       11           1847    1645 2.76 0.92  7.26 0.00 10.94
## 18 sca140180_c       12           1853    1624 2.37 0.76  9.23 0.00 12.36
## 26 sca140260_c       12           1847    1597 2.54 1.35  9.64 0.00 13.54
## 25 sca140250_c       13           3700    3094 2.84 0.70 12.84 0.00 16.38
## 30 sca140300_c       14           3700    2930 2.08 0.86 17.86 0.00 20.81
## 1  sca140010_c       15           1231     893 2.44 0.41 24.61 0.00 27.46
## 5  sca140050_c       15           1235     900 2.27 0.81 24.05 0.00 27.13
## 14 sca140140_c       15           1234     869 2.43 0.97 26.18 0.00 29.58
## 8  sca140080_c       16           1235     782 2.02 0.81 33.85 0.00 36.68
## 16 sca14016s_c       16           1234     744 1.62 0.89 37.20 0.00 39.71
## 24 sca140240_c       16           1231     772 1.71 0.97 34.61 0.00 37.29
## 19 sca140190_c       17           1234     567 1.46 0.81 51.78 0.00 54.05
## 21 sca140210_c       17           1235     607 1.46 0.16 49.23 0.00 50.85
## 33 sca140330_c       17           1231     637 1.62 0.65 45.98 0.00 48.25
## 27 sca140270_c       18           1234     354 0.73 0.08 70.50 0.00 71.31
## 31 sca140310_c       18           1235     356 1.30 0.16 69.72 0.00 71.17
## 34 sca14034s_c       18           1231     409 0.73 0.16 65.88 0.00 66.77
## 
## $summary
##            Mean     SD  Median    Min     Max
## N_valid 1625.00 952.00 1669.00 354.00 3558.00
## OM         2.38   0.73    2.43   0.73    3.40
## NV         0.85   0.33    0.92   0.08    1.40
## NR        18.51  22.17    7.22   0.00   70.50
## ND         0.13   0.75    0.00   0.00    4.39
## ALL       21.86  21.19   11.10   3.52   71.31
## 
## Summary for TR
## The proportion of omitted items varied between 0.73% (items sca140270_c, sca14034s_c) and 3.4% (items sca14028s_c, sca14011s_c).
## The proportion of not valid items varied between 0.08% (item sca140270_c) and 1.4% (item sca14028s_c).
## The proportion of not reached items varied between 0% (items sca140040_c, sca140120_c) and 70.5% (item sca140270_c).
## The proportion of not determinable items varied between 0% and 4.39% (item sca14002s_c).
## The proportion of total missing items varied between 3.52% (item sca14013s_c) and 71.31% (item sca140270_c).
## 

4 IRT Analyses

4.1 Dichotomous items

NEPSroutines::irt_analysis(
  resp = resp,
  vars = vars,
  select = "dich",
  valid = "valid",
  mvs = mvs,
  plots = TRUE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables",
  path_plots = "plots",
  overwrite = TRUE,
  digits = 2,
  verbose = FALSE
)
## 
## IRT summary table
##           Item N_administered N_valid correct   xsi   SE WMNSQ     t  rit  aQ3
## 1  sca140010_c           1231     893   34.04  0.70 0.07  1.05  1.83 0.09 0.05
## 2  sca140040_c           3700    3558   50.98 -0.05 0.04  0.97 -2.52 0.26 0.05
## 3  sca140050_c           1235     900   47.22 -0.40 0.07  1.02  0.73 0.24 0.05
## 4  sca140060_c           1853    1712   54.91 -0.56 0.05  1.02  1.10 0.24 0.05
## 5  sca140070_c           1853    1761   73.88 -1.51 0.06  1.01  0.43 0.18 0.03
## 6  sca140080_c           1235     782   78.52 -1.98 0.09  1.00  0.05 0.23 0.04
## 7  sca140090_c           3700    3473   68.70 -0.91 0.04  0.99 -0.53 0.23 0.04
## 8  sca140100_c           1853    1756   33.54  0.43 0.05  1.02  0.77 0.20 0.06
## 9  sca140120_c           3700    3544   23.19  1.38 0.04  0.95 -2.23 0.26 0.03
## 10 sca140140_c           1234     869   19.91  2.13 0.09  0.97 -0.66 0.30 0.03
## 11 sca140150_c           1853    1750   56.29 -0.63 0.05  1.01  0.37 0.22 0.06
## 12 sca140170_c           1853    1661   69.84 -1.29 0.06  1.00  0.12 0.22 0.04
## 13 sca140180_c           1853    1624   73.28 -1.47 0.06  1.00  0.04 0.24 0.04
## 14 sca140190_c           1234     567   49.21  0.57 0.09  1.03  1.18 0.22 0.05
## 15 sca140210_c           1235     607   73.31 -1.66 0.10  1.02  0.47 0.22 0.05
## 16 sca140220_c           3700    3467   63.34 -0.64 0.04  0.98 -1.39 0.26 0.04
## 17 sca140230_c           1847    1774   24.07  1.65 0.06  1.00 -0.01 0.22 0.04
## 18 sca140240_c           1231     772   49.22 -0.01 0.08  1.04  1.97 0.10 0.05
## 19 sca140250_c           3700    3094   22.62  1.42 0.05  0.98 -0.86 0.26 0.05
## 20 sca140260_c           1847    1597   18.66  2.02 0.07  1.00  0.14 0.20 0.05
## 21 sca140270_c           1234     354   18.93  2.16 0.14  1.03  0.34 0.22 0.06
## 22 sca140290_c           1847    1751   44.20  0.60 0.05  0.99 -0.42 0.22 0.05
## 23 sca140300_c           3700    2930    8.29  2.71 0.07  0.97 -0.64 0.23 0.04
## 24 sca140310_c           1235     356   73.03 -1.64 0.13  0.99 -0.09 0.24 0.04
## 25 sca140320_c           1847    1740   13.10  2.48 0.07  1.03  0.68 0.14 0.04
## 26 sca140330_c           1231     637   52.28 -0.14 0.08  1.08  3.36 0.01 0.06
## 27 sca140021_c           1847    1649   13.71  2.41 0.07  0.99 -0.13 0.21 0.04
## 28 sca140022_c           1847    1652   26.21  1.52 0.06  1.04  1.32 0.19 0.05
## 29 sca140023_c           1847    1653   95.64 -3.05 0.12  1.01  0.11 0.10 0.04
## 30 sca140024_c           1847    1652   58.11 -0.04 0.05  1.04  2.07 0.20 0.05
## 31 sca140025_c           1847    1652   14.23  2.36 0.07  1.00 -0.05 0.21 0.04
## 32 sca140031_c           1847    1699   16.42  2.19 0.07  0.99 -0.12 0.23 0.04
## 33 sca140032_c           1847    1702   33.37  1.13 0.05  1.00 -0.20 0.25 0.04
## 34 sca140033_c           1847    1696   13.56  2.43 0.07  1.00  0.09 0.21 0.04
## 35 sca140111_c           1853    1699   11.71  1.89 0.08  1.01  0.20 0.14 0.05
## 36 sca140112_c           1853    1704   30.11  0.61 0.06  1.04  1.69 0.17 0.05
## 37 sca140113_c           1853    1711   34.83  0.37 0.05  1.03  1.25 0.19 0.05
## 38 sca140131_c           1847    1796   16.82  2.15 0.07  0.98 -0.53 0.22 0.04
## 39 sca140132_c           1847    1802   57.88 -0.02 0.05  1.01  0.85 0.19 0.04
## 40 sca140133_c           1847    1801   91.23 -2.26 0.09  1.00 -0.02 0.15 0.04
## 41 sca140161_c           1234     755   19.21  2.15 0.10  0.99 -0.17 0.25 0.04
## 42 sca140162_c           1234     753   26.03  1.71 0.09  1.02  0.44 0.25 0.04
## 43 sca140163_c           1234     754   81.83 -1.14 0.10  1.01  0.12 0.22 0.04
## 44 sca140201_c           1847    1652   23.91  1.66 0.06  0.98 -0.75 0.26 0.04
## 45 sca140202_c           1847    1655   67.92 -0.51 0.06  0.98 -0.71 0.26 0.04
## 46 sca140203_c           1847    1651   47.06  0.48 0.05  0.99 -0.72 0.29 0.06
## 47 sca140204_c           1847    1652   69.25 -0.58 0.06  1.01  0.37 0.25 0.03
## 48 sca140205_c           1847    1653   52.57  0.23 0.05  0.98 -1.10 0.28 0.05
## 49 sca140281_c           1853    1747   19.86  1.22 0.06  1.03  0.99 0.15 0.05
## 50 sca140282_c           1853    1747   57.13 -0.67 0.05  1.00  0.28 0.26 0.04
## 51 sca140283_c           1853    1750    5.71  2.71 0.10  1.01  0.15 0.10 0.04
## 52 sca140284_c           1853    1747   83.69 -2.18 0.07  1.00  0.09 0.19 0.04
## 53 sca140285_c           1853    1753   75.93 -1.64 0.06  0.99 -0.29 0.24 0.05
## 54 sca140286_c           1853    1749    7.38  2.43 0.09  1.00  0.07 0.13 0.04
## 55 sca140341_c           1231     410   94.39 -3.08 0.22  0.96 -0.14 0.22 0.06
## 56 sca140342_c           1231     412   48.79 -0.01 0.10  1.03  0.98 0.18 0.06
## 57 sca140343_c           1231     411   90.51 -2.49 0.17  0.99 -0.06 0.18 0.05
## 58 sca140344_c           1231     398   61.06 -0.55 0.11  1.06  1.70 0.10 0.06
## 59 sca140345_c           1231     412   91.50 -2.62 0.18  0.98 -0.08 0.19 0.06
## 60 sca140346_c           1231     411   39.17  0.42 0.11  1.00  0.10 0.22 0.06
##    Discr.
## 1    0.42
## 2    1.04
## 3    0.75
## 4    0.74
## 5    0.77
## 6    0.81
## 7    0.92
## 8    0.76
## 9    1.19
## 10   1.14
## 11   0.84
## 12   0.84
## 13   0.84
## 14   0.65
## 15   0.71
## 16   1.00
## 17   0.93
## 18   0.58
## 19   1.00
## 20   0.84
## 21   0.77
## 22   0.98
## 23   1.21
## 24   0.90
## 25   0.68
## 26   0.25
## 27   0.90
## 28   0.65
## 29   0.78
## 30   0.67
## 31   0.87
## 32   0.98
## 33   0.93
## 34   0.92
## 35   0.80
## 36   0.60
## 37   0.70
## 38   1.07
## 39   0.84
## 40   0.98
## 41   0.97
## 42   0.82
## 43   0.90
## 44   1.05
## 45   1.05
## 46   1.01
## 47   0.85
## 48   1.05
## 49   0.59
## 50   0.81
## 51   0.67
## 52   0.80
## 53   0.92
## 54   0.83
## 55   1.78
## 56   0.66
## 57   1.21
## 58   0.39
## 59   1.09
## 60   0.81
## 
## Model fit table
##              N Npars Deviance   AIC   BIC EAPrel WLErel
## 1PL model 3700    61    94500 94622 95001  0.743  0.710
## 2PL model 3700   120    94315 94555 95301  0.742  0.716
## 
## SUMMARY FOR TR
## Percentage correct:
## The percentage of correct responses within dichotomous items varied between 5.71% (item sca140283_c) and 95.64% (item sca140023_c) with an average of 46.19% (SD = 26.3%), and a median of 48% correct responses.
## Item difficulties:
## The estimated item difficulties (or location parameters for polytomous variables) varied between -3.08 (item sca140341_c) and 2.71 (items sca140300_c, sca140283_c) with an average of 0.24 (SD = 1.62), and a median of 0.3.
## SE of item difficulties:
## The maximum of SEs is 0.22 (item sca140341_c).
## WMNSQ:
## The WMNSQ value varied between 0.95 (item sca140120_c) and 1.08 (item sca140330_c) with an average of 1 (SD = 0.02), and a median of 1.
## No item exhibited a WMNSQ of at least 1.15.
## 
## WMNSQ t-value:
## The WMNSQ t-values varied between -2.52 (item sca140040_c) and 3.36 (item sca140330_c) with an average of 0.2 (SD = 0.98), and a median of 0.1.
## No item exhibited a t-value of at least 8.
## 
## Correlation of item scores with total correct score:
## The correlations between the item scores and the total correct scores varied between 0.01 (item sca140330_c) and 0.3 (item sca140140_c) with an average correlation of 0.21 (SD = 0.06), and a median correlation of 0.22.
## Model variance:
## The variance of the model was estimated to be 0.775.
## Test reliability:
## EAP/PV reliability = 0.743
## WLE reliability = 0.71
## Item discrimination:
## The estimated discrimination parameters varied between 0.25 (item sca140330_c) and 1.78 (item sca140341_c) with an average discrimination of 0.86 (SD = 0.23), and a median discrimination of 0.84.
## Thresholds:
## The estimated thresholds varied between -3.08 (item sca140341_c) and 2.71 (items sca140300_c, sca140283_c) with an average of 0.24 (SD = 1.62), and a median of 0.3.

4.2 All items

NEPSroutines::irt_analysis(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  scoring = "scoring",
  mvs = mvs,
  plots = TRUE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables",
  path_plots = "plots",
  overwrite = TRUE,
  digits = 2,
  verbose = FALSE
)
## Warning in steps_analysis(pcm_model = irt$model.pcm, suf_item_names =
## suf_item_names, : NAs durch Umwandlung erzeugt
## 
## IRT summary table
##           Item N_administered N_valid correct   xsi   SE WMNSQ     t  rit  aQ3
## 1  sca140010_c           1231     893   34.04  0.71 0.07  1.06  2.01 0.10 0.06
## 2  sca14002s_c           1847    1639   41.53  0.36 0.03  0.96 -1.17 0.29 0.07
## 3  sca14003s_c           1847    1677   21.07  1.46 0.03  0.94 -1.67 0.33 0.08
## 4  sca140040_c           3700    3558   50.98 -0.05 0.04  0.98 -1.66 0.26 0.06
## 5  sca140050_c           1235     900   47.22 -0.46 0.07  1.03  1.42 0.23 0.05
## 6  sca140060_c           1853    1712   54.91 -0.62 0.05  1.04  2.32 0.24 0.06
## 7  sca140070_c           1853    1761   73.88 -1.60 0.06  1.02  0.75 0.18 0.03
## 8  sca140080_c           1235     782   78.52 -2.08 0.09  1.01  0.24 0.23 0.05
## 9  sca140090_c           3700    3473   68.70 -0.94 0.04  1.00  0.18 0.23 0.05
## 10 sca140100_c           1853    1756   33.54  0.40 0.05  1.04  1.76 0.19 0.07
## 11 sca14011s_c           1853    1678   25.67  0.84 0.03  0.98 -0.45 0.23 0.07
## 12 sca140120_c           3700    3544   23.19  1.43 0.04  0.97 -1.35 0.26 0.04
## 13 sca14013s_c           1847    1782   55.31 -0.13 0.03  0.95 -1.72 0.26 0.06
## 14 sca140140_c           1234     869   19.91  2.26 0.09  0.99 -0.16 0.29 0.04
## 15 sca140150_c           1853    1750   56.29 -0.69 0.05  1.01  0.80 0.21 0.07
## 16 sca14016s_c           1234     744   42.38  0.58 0.05  0.95 -0.93 0.34 0.07
## 17 sca140170_c           1853    1661   69.84 -1.37 0.06  1.02  0.64 0.21 0.04
## 18 sca140180_c           1853    1624   73.28 -1.55 0.06  1.02  0.55 0.24 0.05
## 19 sca140190_c           1234     567   49.21  0.65 0.09  1.06  1.93 0.22 0.06
## 20 sca14020s_c           1847    1645   52.15  0.15 0.02  0.97 -1.15 0.36 0.09
## 21 sca140210_c           1235     607   73.31 -1.76 0.10  1.03  0.71 0.21 0.06
## 22 sca140220_c           3700    3467   63.34 -0.67 0.04  0.99 -0.72 0.26 0.05
## 23 sca140230_c           1847    1774   24.07  1.75 0.06  1.02  0.78 0.22 0.05
## 24 sca140240_c           1231     772   49.22 -0.01 0.08  1.06  2.67 0.10 0.05
## 25 sca140250_c           3700    3094   22.62  1.47 0.05  0.99 -0.48 0.25 0.05
## 26 sca140260_c           1847    1597   18.66  2.13 0.07  1.02  0.39 0.20 0.06
## 27 sca140270_c           1234     354   18.93  2.29 0.14  1.05  0.67 0.21 0.07
## 28 sca14028s_c           1853    1735   41.62  0.37 0.02  1.00 -0.11 0.30 0.07
## 29 sca140290_c           1847    1751   44.20  0.67 0.05  1.02  0.88 0.22 0.06
## 30 sca140300_c           3700    2930    8.29  2.79 0.07  0.98 -0.33 0.23 0.05
## 31 sca140310_c           1235     356   73.03 -1.74 0.13  1.00  0.06 0.24 0.05
## 32 sca140320_c           1847    1740   13.10  2.60 0.07  1.05  0.93 0.15 0.05
## 33 sca140330_c           1231     637   52.28 -0.15 0.08  1.09  3.27 0.01 0.06
## 34 sca14034s_c           1231     409   71.07 -0.88 0.05  1.00  0.04 0.27 0.09
##    Discr.
## 1    0.51
## 2    0.58
## 3    0.82
## 4    1.12
## 5    0.71
## 6    0.67
## 7    0.83
## 8    0.80
## 9    0.98
## 10   0.69
## 11   0.62
## 12   1.18
## 13   0.80
## 14   1.14
## 15   0.94
## 16   0.76
## 17   0.90
## 18   0.81
## 19   0.67
## 20   0.66
## 21   0.68
## 22   1.08
## 23   0.93
## 24   0.52
## 25   1.06
## 26   0.89
## 27   0.76
## 28   0.47
## 29   0.98
## 30   1.19
## 31   0.96
## 32   0.71
## 33   0.34
## 34   0.49
## 
## Model fit table
##               N Npars Deviance   AIC   BIC EAPrel WLErel
## PCM model  3700    61    77688 77810 78189  0.718  0.684
## GPCM model 3700    94    77489 77677 78262  0.721  0.692
## 
## Steps analysis table
##                     step1         step2         step3        step4        step5
## sca14002s_c -2.97 (0.132) -0.53 (0.052)  0.45 (0.062)  1.20 (0.12)         1.85
## sca14003s_c -0.76 (0.052) -0.16 (0.082)          0.92         <NA>         <NA>
## sca14011s_c -0.88 (0.052) -0.10 (0.072)          0.98         <NA>         <NA>
## sca14013s_c -1.87 (0.062)  0.06 (0.052)          1.81         <NA>         <NA>
## sca14016s_c -1.69 (0.092)  0.41 (0.082)          1.28         <NA>         <NA>
## sca14020s_c -1.20 (0.072) -0.47 (0.052)  0.05 (0.052) 0.26 (0.062)         1.36
## sca14028s_c -2.09 (0.122) -1.45 (0.062) -0.76 (0.052) 0.55 (0.072) 1.29 (0.142)
## sca14034s_c -1.25 (0.142) -1.00 (0.142) -0.51 (0.122)  0.07 (0.12) 1.00 (0.112)
##             step6
## sca14002s_c  <NA>
## sca14003s_c  <NA>
## sca14011s_c  <NA>
## sca14013s_c  <NA>
## sca14016s_c  <NA>
## sca14020s_c  <NA>
## sca14028s_c  2.46
## sca14034s_c  1.69
## 
## SUMMARY FOR TR
## Percentage correct:
## The percentage of correct responses within dichotomous items varied between 8.29% (item sca140300_c) and 78.52% (item sca140080_c) with an average of 45.45% (SD = 20.64%), and a median of 48.22% correct responses.
## Item difficulties:
## The estimated item difficulties (or location parameters for polytomous variables) varied between -2.08 (item sca140080_c) and 2.79 (item sca140300_c) with an average of 0.24 (SD = 1.35), and a median of 0.26.
## SE of item difficulties:
## The maximum of SEs is 0.14 (item sca140270_c).
## WMNSQ:
## The WMNSQ value varied between 0.94 (item sca14003s_c) and 1.09 (item sca140330_c) with an average of 1.01 (SD = 0.04), and a median of 1.01.
## No item exhibited a WMNSQ of at least 1.15.
## 
## WMNSQ t-value:
## The WMNSQ t-values varied between -1.72 (item sca14013s_c) and 3.27 (item sca140330_c) with an average of 0.33 (SD = 1.26), and a median of 0.32.
## No item exhibited a t-value of at least 8.
## 
## Correlation of item scores with total correct score:
## The correlations between the item scores and the total correct scores varied between 0.01 (item sca140330_c) and 0.36 (item sca14020s_c) with an average correlation of 0.23 (SD = 0.07), and a median correlation of 0.23.
## Model variance:
## The variance of the model was estimated to be 1.012.
## Test reliability:
## EAP/PV reliability = 0.718
## WLE reliability = 0.684
## Item discrimination:
## The estimated discrimination parameters varied between 0.34 (item sca140330_c) and 1.19 (item sca140300_c) with an average discrimination of 0.8 (SD = 0.22), and a median discrimination of 0.8.
## Thresholds:
## The estimated thresholds varied between -5.37 (item sca14002s_c) and 5.29 (item NA) with an average of 0.25 (SD = 2.47), and a median of 0.23.

5 DIF Analysis

5.1 Dichotomous items

NEPSroutines::dif_analysis(
  resp = resp,
  vars = vars,
  select = "dich",
  valid = "valid",
  dif_vars = c("sex", "books"),
  mvs = mvs,
  overwrite = TRUE,
  verbose = FALSE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables"
)
## 
## RESULTS FOR THE DIF VARIABLE 'sex':
## 
## Facets and group counts:
##         number counts
## Group 0      0   1872
## Group 1      1   1828
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          sex Main effect 3700    94442                   62 94566 94951
## 2          sex         DIF 3700    94358                  121 94600 95352
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model         -0.224       -0.256
## 2 Main effects model         -0.257       -0.294
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
##           item    xsi se.xsi    std   Femp   Fkrit df1  df2 p
## 41 sca140161_c -0.504  0.101 -0.577 24.901 191.245   1 3698 1
## 57 sca140343_c -0.669  0.128 -0.766 27.317 191.245   1 3698 1
## 
## RESULTS FOR THE DIF VARIABLE 'books':
## 
## Facets and group counts:
##         number counts
## Group 0      0   1814
## Group 1      1   1886
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1        books Main effect 3700    94495                   62 94619 95005
## 2        books         DIF 3700    94420                  121 94662 95414
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model          0.069        0.079
## 2 Main effects model          0.075        0.086
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
##           item    xsi se.xsi    std  Femp   Fkrit df1  df2 p
## 29 sca140023_c -0.527  0.113 -0.598 21.75 191.245   1 3698 1

5.2 All items

NEPSroutines::dif_analysis(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  dif_vars = c("sex", "books"),
  scoring = "scoring",
  mvs = mvs,
  control = list(
    Msteps = 6,
    maxiter = 5000
  ),
  overwrite = TRUE,
  verbose = FALSE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables"
)
## 
## RESULTS FOR THE DIF VARIABLE 'sex':
## 
## Facets and group counts:
##         number counts
## Group 0      0   1872
## Group 1      1   1828
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          sex Main effect 3700    77656                   62 77780 78166
## 2          sex         DIF 3700    77583                   95 77773 78363
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model         -0.277       -0.278
## 2 Main effects model         -0.151       -0.151
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
## No items found.
## 
## RESULTS FOR THE DIF VARIABLE 'books':
## 
## Facets and group counts:
##         number counts
## Group 0      0   1814
## Group 1      1   1886
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1        books Main effect 3700    77681                   62 77805 78190
## 2        books         DIF 3700    77632                   95 77822 78412
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model          0.046        0.045
## 2 Main effects model          0.072        0.072
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
## No items found.

6 Distractor Analysis

NEPSroutines::dis_analysis(
  resp = resp,
  vars = vars,
  valid = "valid",
  select_raw = "raw",
  correct = "correct",
  mvs = mvs,
  print = TRUE,
  save = TRUE,
  overwrite = TRUE,
  path_results = "results",
  path_table = "tables"
)
## Warning in cbind(correct = rc[, 3], distract = rd[, 3]): number of rows of
## result is not a multiple of vector length (arg 1)
## 
## Item-total correlation for correct response: 
## Min. = -0.006 (sca1403303)
## Max. = 0.323 (sca1402033)
## Md. = 0.228 ()
## 
## Item-total correlation for distractor: 
## Min. = -0.21 (sca1403103)
## Max. = 0.054 (sca1402833)
## Md. = -0.076 (sca1400906, sca1401203, sca1402205, sca1401312)
## 
## Items with problematic item-total correlations for correct response (r < 0.2): 
## sca1400102, sca1400901, sca1402405, sca1402503, sca1403001, sca1403205, sca1403303, sca1400233, sca1401115, sca1401122, sca1401332, sca1402815, sca1402834, sca1402863, sca1403412, sca1403423, sca1403431, sca1403442, sca1403452, sca1403461
## 
## Items with problematic item-total correlations for distractors (r > 0.05): 
## sca1402833

7 Dimensionality Analysis

vars$component_num <- as.numeric(as.factor(vars$component))
table(vars$component, vars$component_num)
##      
##        1  2
##   KAS 84  0
##   KOS  0 44
NEPSroutines::dim_analysis(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  scoring = "scoring",
  irtmodel = "PCM2",
  dim = "component_num",
  mvs = mvs,
  return = FALSE,
  save = TRUE,
  print = TRUE,
  path_table = "tables", 
  path_results = "results",
  overwrite = TRUE,
  verbose = FALSE
)
## Finished unidimensional reference model.
## Finished component_num model.
## 
## RESULTS:
## [1] "Cor-Var uni"
##       [,1]
## [1,] 1.008
## [1] "Cor-Var component_num"
##       1     2
## 1 1.502 0.547
## 2 0.547 1.474
## [1] "Goodness of fit"
##     Stat    uni component_num
## 1  Npars     61            63
## 2 loglik -38844        -38481
## 3    AIC  77811         77087
## 4    BIC  78190         77479
## 

8 Create Scores and SUF

scores <- NEPSroutines::create_scores(
  resp,
  vars,
  score_name = "sca14",
  select = "mixed",
  valid = "valid",
  scoring = "scoring",
  mvs = mvs,
  wle = TRUE,
  sum_score = TRUE,
  sum_select = "dich",
  metap = FALSE,
  return = TRUE,
  save = TRUE,
  overwrite = TRUE,
  path_results = "results"
)
## Warning in steps_analysis(pcm_model = irt$model.pcm, suf_item_names =
## suf_item_names, : NAs durch Umwandlung erzeugt
NEPSroutines::create_suf(
  resp,
  vars,
  select = "mixed",
  competence = "Science",
  scores = scores,
  score_name = "sca14",
  return = FALSE,
  path = "suf"
)
## SUF successfully saved!
rm(scores)

9 Session

sessionInfo()
## R version 4.6.0 (2026-04-24 ucrt)
## Platform: x86_64-w64-mingw32/x64
## Running under: Windows 11 x64 (build 26200)
## 
## Matrix products: default
##   LAPACK version 3.12.1
## 
## locale:
## [1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8   
## [3] LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                   
## [5] LC_TIME=German_Germany.utf8    
## 
## time zone: Europe/Berlin
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] NEPSroutines_1.2.1
## 
## loaded via a namespace (and not attached):
##  [1] gtable_0.3.6            CDM_8.3-14              xfun_0.57              
##  [4] bslib_0.11.0            ggplot2_4.0.3           lattice_0.22-9         
##  [7] vctrs_0.7.3             tools_4.6.0             generics_0.1.4         
## [10] stats4_4.6.0            parallel_4.6.0          tibble_3.3.1           
## [13] pkgconfig_2.0.3         data.table_1.18.4       RColorBrewer_1.1-3     
## [16] S7_0.2.2                uuid_1.2-2              lifecycle_1.0.5        
## [19] flextable_0.9.12        compiler_4.6.0          farver_2.1.2           
## [22] textshaping_1.0.5       fontquiver_0.2.1        fontLiberation_0.1.0   
## [25] htmltools_0.5.9         sass_0.4.10             WrightMap_1.4          
## [28] yaml_2.3.12             pillar_1.11.1           jquerylib_0.1.4        
## [31] tidyr_1.3.2             MASS_7.3-65             admisc_0.40            
## [34] openssl_2.4.1           cachem_1.1.0            fontBitstreamVera_0.1.1
## [37] polycor_0.8-2           tidyselect_1.2.1        zip_2.3.3              
## [40] digest_0.6.39           mvtnorm_1.4-0           stringi_1.8.7          
## [43] dplyr_1.2.1             purrr_1.2.2             forcats_1.0.1          
## [46] fastmap_1.2.0           grid_4.6.0              colorspace_2.1-2       
## [49] cli_3.6.6               magrittr_2.0.5          TAM_4.3-25             
## [52] withr_3.0.2             gdtools_0.5.1           scales_1.4.0           
## [55] rmarkdown_2.31          officer_0.7.5           otel_0.2.0             
## [58] askpass_1.2.1           ragg_1.5.2              hms_1.1.4              
## [61] openxlsx_4.2.8.1        evaluate_1.0.5          knitr_1.51             
## [64] haven_2.5.5             rlang_1.2.0             Rcpp_1.1.1-1.1         
## [67] glue_1.8.1              xml2_1.5.2              rstudioapi_0.18.0      
## [70] jsonlite_2.0.0          R6_2.6.1                sfsmisc_1.1-24         
## [73] systemfonts_1.3.2