1 Preparation of R and data

1.1 Load data and NEPSroutines

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

library("NEPSroutines")

1.2 User-defined missing values

table(unlist(resp[resp < 0]))
## 
##  -55  -56  -94  -95  -97 
##   71 3400 9609 1118 2990
mvs = c(
  OM = -97,
  NV = -95,
  NR = -94,
  NP = -56,
  ND = -55
)

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"
)

1.3 Attributes for socio-demographic variables

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

# Migration
attributes(resp$mig)$labels <- c(
  no_migration_background = 0,
  migration_background = 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 1500 valid cases and 50 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 1500 6.035 0.909  6.005 4.088 7.921
# Descriptives (attributes, frequency) of nominal socio-demographic variables
NEPSroutines::show_attributes(resp, desc = c("sex", "mig", "books"))
## 
## The attributes for variable sex are:
## female   male 
##      0      1
## 
## The attributes for variable mig are:
## no_migration_background    migration_background 
##                       0                       1
## 
## The attributes for variable books are:
## less_than_100 more_than_100 
##             0             1
NEPSroutines::desc_nom(resp, desc = c("sex", "mig", "books"), valid = "valid")
## 
## Sample size by groups:
##      sex mig books
## 0    765 960   735
## 1    735 236   765
## <NA>   0 304     0
## 
## Frequency of groups including missing values:
##      sex   mig      books
## [1,] "51%" "64%"    "49%"
## [2,] "49%" "15.73%" "51%"
## [3,] "0%"  "20.27%" "0%"
## 
## Frequency of groups excluding missing values:
##      sex   mig      books
## [1,] "51%" "80.27%" "49%"
## [2,] "49%" "19.73%" "51%"

3 Missing Responses Analyses

3.1 Missing Responses by Person

NEPSroutines::mv_person(
  resp = resp,
  vars = vars,
  select = "dich",
  valid = "valid",
  mvs = mvs,
  labels_mvs = labels_mvs,
  missing_by_design = -56,
  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.94 0.35  3.10  0  4.40
## sd      1.61 0.96  4.44  0  4.66
## median  0.00 0.00  1.00  0  3.00
## min     0.00 0.00  0.00  0  0.00
## max    11.00 6.00 27.00  0 28.00
## 

3.2 Missing Responses by Item

NEPSroutines::mv_item(
  resp = resp,
  vars = vars,
  select = "dich",
  valid = "valid",
  position = "pos",
  mvs = mvs,
  labels_mvs = labels_mvs,
  missing_by_design = -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
## 1  mag120010_c        1           1500    1427 3.80 1.07  0.00  0  4.87
## 2  mag120021_c        2           1500    1384 4.53 3.20  0.00  0  7.73
## 3  mag120022_c        2           1500    1392 4.67 2.53  0.00  0  7.20
## 4  mag120023_c        2           1500    1385 5.53 2.13  0.00  0  7.67
## 5  mag120024_c        2           1500    1393 4.20 2.93  0.00  0  7.13
## 6  mag120031_c        3           1500    1439 2.80 0.80  0.47  0  4.07
## 7  mag120032_c        3           1500    1441 2.60 0.87  0.47  0  3.93
## 8  mag120033_c        3           1500    1440 2.60 0.93  0.47  0  4.00
## 9  mag120034_c        3           1500    1437 2.87 0.87  0.47  0  4.20
## 10 mag120035_c        3           1500    1439 2.80 0.80  0.47  0  4.07
## 11 mag120040_c        4           1500    1426 2.40 1.67  0.87  0  4.93
## 12 mag120050_c        5           1500    1418 3.40 1.00  1.07  0  5.47
## 13 mag120061_c        6           1500    1415 3.07 0.93  1.67  0  5.67
## 14 mag120062_c        6           1500    1417 3.00 0.87  1.67  0  5.53
## 15 mag120063_c        6           1500    1421 2.80 0.80  1.67  0  5.27
## 16 mag120064_c        6           1500    1418 3.07 0.73  1.67  0  5.47
## 17 mag120065_c        6           1500    1416 3.00 0.93  1.67  0  5.60
## 18 mag120070_c        7           1500    1412 2.73 0.93  2.20  0  5.87
## 19 mag120080_c        8           1500    1405 2.87 0.67  2.80  0  6.33
## 20 mag120090_c        9           1500    1377 3.00 1.33  3.87  0  8.20
## 21 mag120100_c       10           1500    1387 1.60 1.07  4.87  0  7.53
## 22 mag120110_c       11           1500    1327 2.87 0.87  7.80  0 11.53
## 23 mag120120_c       12           1500    1278 2.27 0.73 11.80  0 14.80
## 24 mag120131_c       13           1500    1188 2.13 1.13 17.53  0 20.80
## 25 mag120132_c       13           1500    1187 2.27 1.07 17.53  0 20.87
## 26 mag120133_c       13           1500    1186 2.33 1.07 17.53  0 20.93
## 27 mag120134_c       13           1500    1189 2.20 1.00 17.53  0 20.73
## 28 mag120135_c       13           1500    1144 5.00 1.20 17.53  0 23.73
## 29 mag120140_c       14           1500    1064 2.87 0.40 25.80  0 29.07
## 30 mag120150_c       15           1500     938 1.60 0.20 35.67  0 37.47
## 31 mag120160_c       16           1500     753 1.80 0.20 47.80  0 49.80
## 32 mag120170_c       17           1500     464 1.27 0.20 67.60  0 69.07
## 
## $summary
##                   Mean     SD  Median     Min     Max
## N_administered 1500.00   0.00 1500.00 1500.00 1500.00
## N_valid        1293.97 222.89 1392.50  464.00 1441.00
## OM                2.94   0.98    2.84    1.27    5.53
## NV                1.10   0.70    0.93    0.20    3.20
## NR                9.70  15.64    1.67    0.00   67.60
## ND                0.00   0.00    0.00    0.00    0.00
## ALL              13.74  14.86    7.16    3.93   69.07
## 
## Summary for TR
## The proportion of omitted items varied between 1.27% (item mag120170_c) and 5.53% (item mag120023_c).
## The proportion of not valid items varied between 0.2% (items mag120150_c, mag120160_c, mag120170_c) and 3.2% (item mag120021_c).
## The proportion of not reached items varied between 0% and 67.6% (item mag120170_c).
## The proportion of not determinable items varied between 0% and 0%.
## The proportion of total missing items varied between 3.93% (item mag120032_c) and 69.07% (item mag120170_c).
## 

4 IRT Analyses

4.1 Dichotomous items

NEPSroutines::irt_analysis(
  resp = resp,
  vars = vars,
  select = "dich",
  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
)
## 
## IRT summary table
##           Item N_administered N_valid correct   xsi   SE WMNSQ     t  rit  aQ3
## 1  mag120010_c           1500    1427   62.86 -0.66 0.06  1.01  0.22 0.33 0.03
## 2  mag120040_c           1500    1426    4.77  3.49 0.13  1.00  0.05 0.17 0.03
## 3  mag120050_c           1500    1418   23.62  1.42 0.07  1.02  0.51 0.32 0.03
## 4  mag120070_c           1500    1412   64.16 -0.73 0.06  0.98 -0.73 0.38 0.03
## 5  mag120080_c           1500    1405   60.71 -0.56 0.06  1.01  0.26 0.36 0.03
## 6  mag120090_c           1500    1377   83.95 -2.00 0.08  1.02  0.45 0.26 0.03
## 7  mag120100_c           1500    1387   69.86 -1.04 0.06  1.05  1.68 0.28 0.04
## 8  mag120110_c           1500    1327   46.19  0.19 0.06  1.02  0.85 0.37 0.04
## 9  mag120120_c           1500    1278   69.01 -0.99 0.07  0.99 -0.37 0.35 0.03
## 10 mag120140_c           1500    1064   19.36  1.75 0.08  1.01  0.15 0.32 0.03
## 11 mag120150_c           1500     938   35.18  0.75 0.08  1.06  1.69 0.33 0.05
## 12 mag120160_c           1500     753   49.00  0.04 0.08  0.99 -0.31 0.42 0.04
## 13 mag120170_c           1500     464   74.57 -1.33 0.12  1.06  1.00 0.30 0.04
## 14 mag120021_c           1500    1384   38.66  0.58 0.06  1.01  0.32 0.35 0.04
## 15 mag120022_c           1500    1392   62.14 -0.60 0.06  1.03  1.11 0.33 0.04
## 16 mag120023_c           1500    1385    9.60  2.67 0.10  1.00  0.01 0.24 0.03
## 17 mag120024_c           1500    1393   68.56 -0.95 0.06  0.99 -0.23 0.34 0.03
## 18 mag120031_c           1500    1439   16.96  1.92 0.08  0.99 -0.26 0.31 0.03
## 19 mag120032_c           1500    1441   18.11  1.82 0.07  0.98 -0.39 0.33 0.03
## 20 mag120033_c           1500    1440   50.07 -0.01 0.06  1.01  0.59 0.34 0.03
## 21 mag120034_c           1500    1437   64.93 -0.76 0.06  1.00 -0.16 0.35 0.04
## 22 mag120035_c           1500    1439   10.22  2.58 0.09  0.98 -0.22 0.25 0.03
## 23 mag120061_c           1500    1415   40.28  0.48 0.06  0.99 -0.39 0.37 0.04
## 24 mag120062_c           1500    1417   42.98  0.35 0.06  1.00  0.13 0.37 0.03
## 25 mag120063_c           1500    1421   87.76 -2.35 0.09  1.02  0.38 0.23 0.04
## 26 mag120064_c           1500    1418   19.25  1.74 0.07  0.98 -0.59 0.35 0.02
## 27 mag120065_c           1500    1416   87.57 -2.33 0.09  1.00  0.02 0.24 0.03
## 28 mag120131_c           1500    1188   28.62  1.11 0.07  0.97 -0.76 0.39 0.04
## 29 mag120132_c           1500    1187   19.38  1.72 0.08  0.96 -0.98 0.38 0.04
## 30 mag120133_c           1500    1186   39.12  0.54 0.07  0.94 -2.43 0.46 0.03
## 31 mag120134_c           1500    1189   19.26  1.73 0.08  1.00  0.08 0.32 0.03
## 32 mag120135_c           1500    1144   20.98  1.60 0.08  0.95 -1.12 0.40 0.04
##    Discr.
## 1    1.02
## 2    1.01
## 3    1.01
## 4    1.14
## 5    1.04
## 6    0.91
## 7    0.81
## 8    0.97
## 9    1.09
## 10   1.02
## 11   0.84
## 12   1.11
## 13   0.80
## 14   1.01
## 15   0.94
## 16   1.13
## 17   1.10
## 18   1.15
## 19   1.20
## 20   1.01
## 21   1.10
## 22   1.15
## 23   1.11
## 24   1.05
## 25   0.95
## 26   1.23
## 27   1.04
## 28   1.19
## 29   1.33
## 30   1.37
## 31   1.08
## 32   1.38
## 
## Model fit table
##              N Npars Deviance   AIC   BIC EAPrel WLErel
## 1PL model 1500    33    41530 41596 41771  0.821  0.806
## 2PL model 1500    64    41476 41604 41944  0.821  0.806
## 
## SUMMARY FOR TR
## Percentage correct:
## The percentage of correct responses within dichotomous items varied between 4.77% (item mag120040_c) and 87.76% (item mag120063_c) with an average of 43.99% (SD = 24.85%), and a median of 41.63% correct responses.
## Item difficulties:
## The estimated item difficulties (or location parameters for polytomous variables) varied between -2.35 (item mag120063_c) and 3.49 (item mag120040_c) with an average of 0.38 (SD = 1.5), and a median of 0.42.
## SE of item difficulties:
## The maximum of SEs is 0.13 (item mag120040_c).
## WMNSQ:
## The WMNSQ value varied between 0.94 (item mag120133_c) and 1.06 (items mag120150_c, mag120170_c) with an average of 1 (SD = 0.03), 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.43 (item mag120133_c) and 1.69 (item mag120150_c) with an average of 0.02 (SD = 0.81), and a median of 0.04.
## 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.17 (item mag120040_c) and 0.46 (item mag120133_c) with an average correlation of 0.33 (SD = 0.06), and a median correlation of 0.34.
## Model variance:
## The variance of the model was estimated to be 1.136.
## Test reliability:
## EAP/PV reliability = 0.821
## WLE reliability = 0.806
## Item discrimination:
## The estimated discrimination parameters varied between 0.8 (item mag120170_c) and 1.38 (item mag120135_c) with an average discrimination of 1.07 (SD = 0.14), and a median discrimination of 1.06.
## Thresholds:
## The estimated thresholds varied between -2.35 (item mag120063_c) and 3.49 (item mag120040_c) with an average of 0.38 (SD = 1.5), and a median of 0.42.

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  mag120010_c           1500    1427   62.86 -0.68 0.06  1.03  1.08 0.33 0.04
## 2  mag12002s_c           1500    1371   44.73  0.32 0.03  0.95 -1.64 0.45 0.04
## 3  mag12003s_c           1500    1435   32.04  0.72 0.03  0.90 -2.72 0.50 0.04
## 4  mag120040_c           1500    1426    4.77  3.60 0.13  1.02  0.19 0.17 0.03
## 5  mag120050_c           1500    1418   23.62  1.47 0.07  1.05  1.25 0.32 0.04
## 6  mag12006s_c           1500    1411   55.55 -0.29 0.03  0.92 -2.38 0.49 0.04
## 7  mag120070_c           1500    1412   64.16 -0.75 0.06  0.99 -0.23 0.37 0.04
## 8  mag120080_c           1500    1405   60.71 -0.58 0.06  1.04  1.37 0.36 0.04
## 9  mag120090_c           1500    1377   83.95 -2.07 0.08  1.04  0.76 0.26 0.03
## 10 mag120100_c           1500    1387   69.86 -1.08 0.07  1.06  1.86 0.28 0.05
## 11 mag120110_c           1500    1327   46.19  0.20 0.06  1.03  1.07 0.37 0.06
## 12 mag120120_c           1500    1278   69.01 -1.02 0.07  1.00  0.10 0.35 0.03
## 13 mag12013s_c           1500    1181   25.45  0.82 0.03  0.91 -2.26 0.56 0.05
## 14 mag120140_c           1500    1064   19.36  1.81 0.09  1.02  0.53 0.32 0.03
## 15 mag120150_c           1500     938   35.18  0.77 0.08  1.06  1.66 0.33 0.06
## 16 mag120160_c           1500     753   49.00  0.05 0.08  1.02  0.63 0.42 0.05
## 17 mag120170_c           1500     464   74.57 -1.37 0.12  1.08  1.34 0.30 0.05
##    Discr.
## 1    1.05
## 2    0.71
## 3    0.88
## 4    1.02
## 5    1.02
## 6    0.80
## 7    1.20
## 8    1.05
## 9    0.94
## 10   0.85
## 11   1.01
## 12   1.14
## 13   0.88
## 14   1.04
## 15   0.88
## 16   1.13
## 17   0.82
## 
## Model fit table
##               N Npars Deviance   AIC   BIC EAPrel WLErel
## PCM model  1500    33    31997 32063 32239  0.775  0.749
## GPCM model 1500    49    31877 31975 32236  0.791  0.770
## 
## Steps analysis table
##                     step1         step2         step3        step4 step5
## mag12002s_c -1.13 (0.072) -0.58 (0.062)  0.12 (0.072)         1.59  <NA>
## mag12003s_c -1.42 (0.072) -0.63 (0.062)  0.10 (0.072) 0.83 (0.122)  1.12
## mag12006s_c -1.65 (0.092) -0.98 (0.072)  0.21 (0.062) 0.82 (0.072)  1.60
## mag12013s_c -0.67 (0.062) -0.23 (0.072) -0.09 (0.092) 0.29 (0.132)  0.70
## 
## SUMMARY FOR TR
## Percentage correct:
## The percentage of correct responses within dichotomous items varied between 4.77% (item mag120040_c) and 83.95% (item mag120090_c) with an average of 48.29% (SD = 22.14%), and a median of 49% correct responses.
## Item difficulties:
## The estimated item difficulties (or location parameters for polytomous variables) varied between -2.07 (item mag120090_c) and 3.6 (item mag120040_c) with an average of 0.11 (SD = 1.37), and a median of 0.05.
## SE of item difficulties:
## The maximum of SEs is 0.13 (item mag120040_c).
## WMNSQ:
## The WMNSQ value varied between 0.9 (item mag12003s_c) and 1.08 (item mag120170_c) with an average of 1.01 (SD = 0.06), and a median of 1.02.
## No item exhibited a WMNSQ of at least 1.15.
## 
## WMNSQ t-value:
## The WMNSQ t-values varied between -2.72 (item mag12003s_c) and 1.86 (item mag120100_c) with an average of 0.15 (SD = 1.49), and a median of 0.63.
## 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.17 (item mag120040_c) and 0.56 (item mag12013s_c) with an average correlation of 0.36 (SD = 0.1), and a median correlation of 0.35.
## Model variance:
## The variance of the model was estimated to be 1.41.
## Test reliability:
## EAP/PV reliability = 0.775
## WLE reliability = 0.749
## Item discrimination:
## The estimated discrimination parameters varied between 0.71 (item mag12002s_c) and 1.2 (item mag120070_c) with an average discrimination of 0.97 (SD = 0.13), and a median discrimination of 1.01.
## Thresholds:
## The estimated thresholds varied between -4.56 (item mag12006s_c) and 4.6 (item NA) with an average of 0.48 (SD = 2.18), and a median of 0.13.

5 DIF Analysis

5.1 Dichotomous items

NEPSroutines::dif_analysis(
  resp = resp,
  vars = vars,
  select = "dich",
  valid = "valid",
  dif_vars = c("sex", "mig", "books"),
  scoring = "scoring",
  mvs = mvs,
  overwrite = TRUE,
  verbose = FALSE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables"
)
## Warning in warn_included_missings(dif_var, mis): 304 missing values were found in the DIF variable mig. The corresponding cases were included in the analysis as an extra group.
## 
## RESULTS FOR THE DIF VARIABLE 'sex':
## 
## Facets and group counts:
##         number counts
## Group 0      0    765
## Group 1      1    735
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          sex Main effect 1500    41493                   34 41561 41742
## 2          sex         DIF 1500    41454                   65 41584 41929
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model         -0.356       -0.338
## 2 Main effects model         -0.365       -0.348
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
##          item    xsi se.xsi    std   Femp  Fkrit df1  df2     p
## 2 mag120040_c -0.509  0.095 -0.484 28.707 88.573   1 1498 0.991
## 
## RESULTS FOR THE DIF VARIABLE 'mig':
## 
## Facets and group counts:
##          number counts
## Group 0       1    960
## Group 1       2    236
## missings      3    304
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          mig Main effect 1500    41466                   35 41536 41722
## 2          mig         DIF 1500    41404                   97 41598 42114
## 
## Main effects of DIF model and main effects model:
## Comparison 1-2:
##                Model Unstandardized Standardized
## 1          DIF model          0.650        0.624
## 2 Main effects model          0.668        0.642
## Comparison 1-3:
##                Model Unstandardized Standardized
## 1          DIF model          0.050        0.048
## 2 Main effects model          0.043        0.042
## Comparison 2-3:
##                Model Unstandardized Standardized
## 1          DIF model         -0.600       -0.576
## 2 Main effects model         -0.624       -0.601
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 1-2:
##           item    xsi se.xsi    std   Femp  Fkrit df1  df2     p
## 2  mag120040_c  0.796  0.138  0.764 33.271 88.573   1 1498 0.975
## 3  mag120050_c  0.745  0.104  0.715 51.315 88.573   1 1498 0.717
## 10 mag120140_c -0.569  0.121 -0.546 22.113 88.573   1 1498 0.999
## 29 mag120132_c  0.534  0.113  0.513 22.332 88.573   1 1498 0.999
## Comparison 1-3:
## No items found.
## Comparison 2-3:
##           item    xsi se.xsi    std   Femp  Fkrit df1  df2     p
## 2  mag120040_c -1.066  0.166 -1.024 41.238 88.573   1 1498 0.905
## 3  mag120050_c -0.637  0.124 -0.612 26.390 88.573   1 1498 0.995
## 10 mag120140_c  0.511  0.147  0.491 12.084 88.573   1 1498     1
## 
## RESULTS FOR THE DIF VARIABLE 'books':
## 
## Facets and group counts:
##         number counts
## Group 0      0    735
## Group 1      1    765
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1        books Main effect 1500    41529                   34 41597 41778
## 2        books         DIF 1500    41503                   65 41633 41979
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model          0.040        0.038
## 2 Main effects model          0.032        0.030
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
## No items found.

5.2 All items

NEPSroutines::dif_analysis(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  dif_vars = c("sex", "mig", "books"),
  scoring = "scoring",
  mvs = mvs,
  overwrite = TRUE,
  verbose = FALSE,
  save = TRUE,
  print = TRUE,
  return = FALSE,
  path_results = "results",
  path_table = "tables"
)
## Warning in warn_included_missings(dif_var, mis): 304 missing values were found in the DIF variable mig. The corresponding cases were included in the analysis as an extra group.
## 
## RESULTS FOR THE DIF VARIABLE 'sex':
## 
## Facets and group counts:
##         number counts
## Group 0      0    765
## Group 1      1    735
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          sex Main effect 1500    31960                   38 32036 32238
## 2          sex         DIF 1500    31932                   54 32040 32327
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model         -0.314       -0.268
## 2 Main effects model         -0.245       -0.209
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 0-1:
## No items found.
## 
## RESULTS FOR THE DIF VARIABLE 'mig':
## 
## Facets and group counts:
##          number counts
## Group 0       1    960
## Group 1       2    236
## missings      3    304
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1          mig Main effect 1500    31941                   39 32019 32226
## 2          mig         DIF 1500    31888                   71 32030 32407
## 
## Main effects of DIF model and main effects model:
## Comparison 1-2:
##                Model Unstandardized Standardized
## 1          DIF model          0.587        0.506
## 2 Main effects model          0.435        0.375
## Comparison 1-3:
##                Model Unstandardized Standardized
## 1          DIF model          0.042        0.036
## 2 Main effects model          0.031        0.027
## Comparison 2-3:
##                Model Unstandardized Standardized
## 1          DIF model         -0.545       -0.470
## 2 Main effects model         -0.404       -0.348
## 
## Items exhibiting problematic DIF (|xsi| >= 0.5):
## 
## Comparison 1-2:
##           item    xsi se.xsi    std   Femp  Fkrit df1  df2     p
## 4  mag120040_c  0.732  0.177  0.631 17.103 88.573   1 1498     1
## 5  mag120050_c  0.683  0.119  0.589 32.942 88.573   1 1498 0.977
## 14 mag120140_c -0.651  0.145 -0.561 20.157 88.573   1 1498 0.999
## Comparison 1-3:
## No items found.
## Comparison 2-3:
##           item    xsi se.xsi    std   Femp  Fkrit df1  df2     p
## 1  mag120010_c  0.520  0.130  0.448 16.000 88.573   1 1498     1
## 4  mag120040_c -1.031  0.211 -0.889 23.875 88.573   1 1498 0.998
## 5  mag120050_c -0.593  0.141 -0.511 17.688 88.573   1 1498     1
## 14 mag120140_c  0.571  0.177  0.492 10.407 88.573   1 1498     1
## 
## RESULTS FOR THE DIF VARIABLE 'books':
## 
## Facets and group counts:
##         number counts
## Group 0      0    735
## Group 1      1    765
## 
## Information criteria:
##   DIF.variable       Model    N Deviance Number.of.parameters   AIC   BIC
## 1        books Main effect 1500    31997                   38 32073 32275
## 2        books         DIF 1500    31985                   54 32093 32380
## 
## Main effects of DIF model and main effects model:
## Comparison 0-1:
##                Model Unstandardized Standardized
## 1          DIF model          0.042        0.035
## 2 Main effects model          0.021        0.018
## 
## 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.181 (mag1200406)
## Max. = 0.461 (mag1201332)
## Md. = 0.3685 ()
## 
## Item-total correlation for distractor: 
## Min. = -0.247 (mag1200702)
## Max. = 0.292 (mag1201603)
## Md. = -0.0845 ()
## 
## Items with problematic item-total correlations for correct response (r < 0.2): 
## mag1200406
## 
## Items with problematic item-total correlations for distractors (r > 0.05): 
## mag1200902, mag12009024, mag12015011, mag12015019, mag1201603, mag1201604, mag1201704, mag1201709, mag12017012, mag12017013

7 Dimensionality Analysis

vars$content_num <- as.numeric(as.factor(vars$content))
table(vars$content, vars$content_num)
##         
##           1  2  3  4
##   change 13  0  0  0
##   data    0 26  0  0
##   space   0  0 10  0
##   units   0  0  0 19
NEPSroutines::dim_analysis(
  resp = resp,
  vars = vars,
  select = "mixed",
  valid = "valid",
  scoring = "scoring",
  irtmodel = "PCM2",
  dim = "content_num",
  mvs = mvs,
  return = FALSE,
  save = TRUE,
  print = TRUE,
  path_table = "tables", 
  path_results = "results",
  overwrite = TRUE,
  verbose = FALSE
)
## Finished unidimensional reference model.
## Finished content_num model.
## 
## RESULTS:
## [1] "Cor-Var uni"
##       [,1]
## [1,] 1.408
## [1] "Cor-Var content_num"
##       1     2     3     4
## 1 2.507 0.763 0.625 0.730
## 2 0.763 2.733 0.661 0.797
## 3 0.625 0.661 1.752 0.635
## 4 0.730 0.797 0.635 2.112
## [1] "Goodness of fit"
##     Stat    uni content_num
## 1  Npars     33          42
## 2 loglik -15999      -15890
## 3    AIC  32063       31864
## 4    BIC  32239       32087
## 

8 Create Scores and SUF

scores <- NEPSroutines::create_scores(
  resp,
  vars,
  score_name = "mag12",
  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 = "Math",
  scores = scores,
  score_name = "mag12",
  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