Protokoll: 02_DIF 
R: R version 4.5.1 (2025-06-13) | Locale: en_US.UTF-8 
Zeit: 2026-08-09 10:38:59 
====================================================================== 


> prepare_data()

> suppressPackageStartupMessages({
+   library(dplyr); library(purrr); library(tibble); library(tidyr)
+ })

> label_e4 <- c("Appointment scheduling and organization",
+               "Documentation of findings, visits, or therapy",
+               "Monitorin ..." ... [TRUNCATED] 

> X <- as.data.frame(lapply(df[e4_vars], function(x) as.integer(as.character(x) == "Ja")))

> names(X) <- e4_vars

> score_total <- rowSums(X)

> CRIT <- 0.035          # Zedeck-Kriterium fuer relevantes DIF

> # --- DIF-Routine -------------------------------------------------------------
> # purify = TRUE verwendet den Restscore (Gesamtscore ohne das gepr .... [TRUNCATED] 

> # --- Primaeranalyse: Sprachgruppe -------------------------------------------
> cat("\n############ PRIMAERANALYSE ############\n")

############ PRIMAERANALYSE ############

> keep_lang <- df$lang %in% c("German", "Italian")

> dif_lang  <- dif_run(keep_lang, df$lang == "Italian", "Deutsch", "Italienisch")


=== DIF: Deutsch (n = 613) gegen Italienisch (n = 213) ===
Konditionierung: Gesamtscore 

# A tibble: 16 × 7
   application     OR_gruppe delta_R2 p_uniform q_uniform p_nonuniform
   <chr>               <dbl>    <dbl>     <dbl>     <dbl>        <dbl>
 1 Risk assessmen…     1.86     0.007     0.005     0.079        0.433
 2 Support in med…     1.74     0.006     0.015     0.084        0.808
 3 Patient inform…     0.62     0.005     0.016     0.084        0.54 
 4 Analysis of cl…     0.631    0.003     0.065     0.207        0.846
 5 Surgical proce…     1.45     0.003     0.062     0.207        0.302
 6 Management of …     1.48     0.003     0.086     0.23         0.034
 7 Documentation …     0.725    0.002     0.133     0.304        0.083
 8 Support in urg…     0.734    0.002     0.194     0.388        0.647
 9 Evaluation of …     0.818    0.001     0.36      0.576        0.618
10 Nursing support     1.23     0.001     0.341     0.576        0.776
11 Appointment sc…     0.937    0         0.773     0.898        0.8  
12 Monitoring of …     0.872    0         0.528     0.739        0.984
13 Support in dia…     1.06     0         0.786     0.898        0.62 
14 Support in ind…     0.973    0         0.907     0.907        0.898
15 Automated medi…     1.04     0         0.871     0.907        0.553
16 Planning and c…     0.871    0         0.555     0.739        0.565
# ℹ 1 more variable: relevant <lgl>

Groesstes delta Pseudo-R2: 0.0070 (Kriterium 0.035)
Items ueber dem Kriterium: 0 von 16
Items mit q < .05 (uniform): 0 | nicht-uniform: 0 
Kleinstes q (uniform): 0.0788 

> dif_lang_p <- dif_run(keep_lang, df$lang == "Italian", "Deutsch", "Italienisch",
+                       purify = TRUE)


=== DIF: Deutsch (n = 613) gegen Italienisch (n = 213) ===
Konditionierung: Restscore (ohne das jeweilige Item) 

# A tibble: 16 × 7
   application     OR_gruppe delta_R2 p_uniform q_uniform p_nonuniform
   <chr>               <dbl>    <dbl>     <dbl>     <dbl>        <dbl>
 1 Risk assessmen…     1.80     0.007     0.004     0.058        0.575
 2 Support in med…     1.72     0.006     0.009     0.073        0.668
 3 Patient inform…     0.655    0.005     0.023     0.124        0.571
 4 Analysis of cl…     0.655    0.003     0.064     0.205        0.858
 5 Surgical proce…     1.45     0.003     0.048     0.193        0.401
 6 Management of …     1.43     0.003     0.093     0.249        0.028
 7 Documentation …     0.751    0.002     0.151     0.345        0.084
 8 Evaluation of …     0.85     0.001     0.423     0.676        0.75 
 9 Support in urg…     0.794    0.001     0.289     0.513        0.678
10 Nursing support     1.25     0.001     0.27      0.513        0.651
11 Appointment sc…     0.949    0         0.805     0.92         0.805
12 Monitoring of …     0.884    0         0.537     0.748        0.878
13 Support in dia…     1.08     0         0.71      0.874        0.775
14 Support in ind…     0.986    0         0.946     0.946        0.723
15 Automated medi…     1.04     0         0.863     0.92         0.571
16 Planning and c…     0.883    0         0.561     0.748        0.504
# ℹ 1 more variable: relevant <lgl>

Groesstes delta Pseudo-R2: 0.0074 (Kriterium 0.035)
Items ueber dem Kriterium: 0 von 16
Items mit q < .05 (uniform): 0 | nicht-uniform: 0 
Kleinstes q (uniform): 0.0584 

> cat("\n--- Vergleich Gesamtscore gegen Restscore ---\n")

--- Vergleich Gesamtscore gegen Restscore ---

> cmp <- tibble(application = dif_lang$application,
+               delta_R2_gesamt = round(dif_lang$delta_R2, 4),
+               delta_R2_rest   = r .... [TRUNCATED] 

> print(head(cmp, 6))
# A tibble: 6 × 4
  application                  delta_R2_gesamt delta_R2_rest Differenz
  <chr>                                  <dbl>         <dbl>     <dbl>
1 Risk assessment and prognos…          0.007         0.0074    0.0004
2 Support in medical emergenc…          0.0056        0.0065    0.0009
3 Patient information and edu…          0.0053        0.0047   -0.0006
4 Surgical procedures using r…          0.0031        0.0035    0.0004
5 Analysis of clinical data (…          0.0033        0.0033    0     
6 Management of the electroni…          0.0029        0.0027   -0.0002

> cat("Maximale Differenz:", max(abs(cmp$Differenz), na.rm = TRUE), "\n")
Maximale Differenz: 9e-04 

> # --- Sekundaeranalysen -------------------------------------------------------
> cat("\n\n############ SEKUNDAERANALYSEN ############\n")


############ SEKUNDAERANALYSEN ############

> cat("Der Wohnort ist hier besonders relevant, weil Sprachgruppe und Urbanitaet\n")
Der Wohnort ist hier besonders relevant, weil Sprachgruppe und Urbanitaet

> cat("in Suedtirol strukturell verschraenkt sind (Cramers V = 0,48).\n")
in Suedtirol strukturell verschraenkt sind (Cramers V = 0,48).

> keep_age <- df$age %in% c("18-40 y", "61-80 y")

> dif_age  <- dif_run(keep_age, df$age == "61-80 y", "18-40 Jahre", "61-80 Jahre")


=== DIF: 18-40 Jahre (n = 287) gegen 61-80 Jahre (n = 247) ===
Konditionierung: Gesamtscore 

# A tibble: 16 × 7
   application     OR_gruppe delta_R2 p_uniform q_uniform p_nonuniform
   <chr>               <dbl>    <dbl>     <dbl>     <dbl>        <dbl>
 1 Patient inform…     0.366    0.028     0         0            0.573
 2 Support in urg…     2.46     0.019     0.001     0.003        0.756
 3 Surgical proce…     2.19     0.017     0         0.003        0.003
 4 Documentation …     0.487    0.013     0.002     0.008        0.411
 5 Support in med…     2.00     0.011     0.006     0.018        0.889
 6 Appointment sc…     0.573    0.009     0.025     0.056        0.414
 7 Analysis of cl…     0.507    0.009     0.013     0.035        0.001
 8 Evaluation of …     1.46     0.003     0.125     0.25         0.811
 9 Automated medi…     0.686    0.003     0.177     0.283        0.304
10 Planning and c…     0.699    0.003     0.169     0.283        0.279
11 Monitoring of …     1.22     0.001     0.405     0.505        0.232
12 Support in ind…     0.794    0.001     0.365     0.505        0.546
13 Risk assessmen…     0.823    0.001     0.41      0.505        0.753
14 Management of …     0.855    0.001     0.523     0.598        0.641
15 Support in dia…     1.06     0         0.818     0.873        0.865
16 Nursing support     1.02     0         0.926     0.926        0.394
# ℹ 1 more variable: relevant <lgl>

Groesstes delta Pseudo-R2: 0.0281 (Kriterium 0.035)
Items ueber dem Kriterium: 0 von 16
Items mit q < .05 (uniform): 6 | nicht-uniform: 2 
Kleinstes q (uniform): 1e-04 

> dif_sex  <- dif_run(rep(TRUE, nrow(df)), df$sex == "Female", "Maenner", "Frauen")


=== DIF: Maenner (n = 426) gegen Frauen (n = 475) ===
Konditionierung: Gesamtscore 

# A tibble: 16 × 7
   application     OR_gruppe delta_R2 p_uniform q_uniform p_nonuniform
   <chr>               <dbl>    <dbl>     <dbl>     <dbl>        <dbl>
 1 Management of …     2.04     0.012     0         0.003        0.152
 2 Automated medi…     1.69     0.006     0.016     0.131        0.242
 3 Analysis of cl…     1.35     0.002     0.147     0.529        0    
 4 Patient inform…     0.797    0.002     0.165     0.529        0.668
 5 Nursing support     0.765    0.002     0.138     0.529        1    
 6 Documentation …     0.798    0.001     0.208     0.554        0.453
 7 Support in med…     0.814    0.001     0.277     0.634        0.214
 8 Planning and c…     1.18     0.001     0.393     0.774        0.259
 9 Appointment sc…     1.06     0         0.753     0.819        0.289
10 Monitoring of …     1.07     0         0.705     0.819        0.576
11 Evaluation of …     0.936    0         0.715     0.819        0.977
12 Support in dia…     0.871    0         0.436     0.774        0.285
13 Support in ind…     0.945    0         0.768     0.819        0.287
14 Risk assessmen…     1.10     0         0.605     0.819        0.453
15 Support in urg…     0.94     0         0.752     0.819        0.885
16 Surgical proce…     1.01     0         0.928     0.928        0.652
# ℹ 1 more variable: relevant <lgl>

Groesstes delta Pseudo-R2: 0.0124 (Kriterium 0.035)
Items ueber dem Kriterium: 0 von 16
Items mit q < .05 (uniform): 1 | nicht-uniform: 1 
Kleinstes q (uniform): 0.0028 

> dif_urb  <- dif_run(rep(TRUE, nrow(df)), df$urban == "Bolzano city",
+                     "uebriges Land", "Bozen")


=== DIF: uebriges Land (n = 731) gegen Bozen (n = 170) ===
Konditionierung: Gesamtscore 

# A tibble: 16 × 7
   application     OR_gruppe delta_R2 p_uniform q_uniform p_nonuniform
   <chr>               <dbl>    <dbl>     <dbl>     <dbl>        <dbl>
 1 Support in urg…     0.577    0.004     0.033     0.171        0.013
 2 Patient inform…     0.626    0.004     0.027     0.171        0.543
 3 Surgical proce…     1.62     0.004     0.025     0.171        0.483
 4 Risk assessmen…     1.60     0.003     0.043     0.171        0.371
 5 Evaluation of …     1.28     0.001     0.29      0.737        0.822
 6 Support in dia…     0.83     0.001     0.412     0.737        0.806
 7 Analysis of cl…     0.8      0.001     0.397     0.737        0.536
 8 Planning and c…     0.744    0.001     0.227     0.726        0.249
 9 Appointment sc…     1.02     0         0.933     0.933        0.251
10 Documentation …     1.14     0         0.559     0.745        0.707
11 Monitoring of …     0.851    0         0.484     0.737        0.364
12 Support in ind…     1.22     0         0.43      0.737        0.405
13 Support in med…     1.18     0         0.507     0.737        0.665
14 Nursing support     1.05     0         0.832     0.888        0.396
15 Automated medi…     1.10     0         0.741     0.846        0.961
16 Management of …     1.1      0         0.69      0.846        0.246
# ℹ 1 more variable: relevant <lgl>

Groesstes delta Pseudo-R2: 0.0042 (Kriterium 0.035)
Items ueber dem Kriterium: 0 von 16
Items mit q < .05 (uniform): 0 | nicht-uniform: 0 
Kleinstes q (uniform): 0.1709 

> # --- Zusammenfassung ---------------------------------------------------------
> cat("\n\n=== Zusammenfassung ueber alle vier Gruppierungen ===\n")


=== Zusammenfassung ueber alle vier Gruppierungen ===

> summ <- bind_rows(
+   mutate(dif_lang, Gruppierung = "Sprachgruppe (D/I)"),
+   mutate(dif_age,  Gruppierung = "Alter (18-40/61-80)"),
+   mutate(d .... [TRUNCATED] 

> print(summ)
# A tibble: 4 × 6
  Gruppierung    max_delta_R2 Items_ueber_Kriterium q_uniform_unter_05
  <chr>                 <dbl>                 <int>              <int>
1 Alter (18-40/…       0.0281                     0                  6
2 Geschlecht           0.0124                     0                  1
3 Sprachgruppe …       0.007                      0                  0
4 Wohnort (Land…       0.0042                     0                  0
# ℹ 2 more variables: q_nonuniform_unter_05 <int>, kleinstes_q <dbl>

> cat("\nLesehilfe: Ein Zuwachs an Pseudo-R2 unter 0,035 gilt als vernachlaessigbar,\n")

Lesehilfe: Ein Zuwachs an Pseudo-R2 unter 0,035 gilt als vernachlaessigbar,

> cat("auch wenn der zugehoerige Test bei dieser Fallzahl signifikant wird. Sind\n")
auch wenn der zugehoerige Test bei dieser Fallzahl signifikant wird. Sind

> cat("alle vier Gruppierungen unauffaellig, ist das ein Positivergebnis: Das\n")
alle vier Gruppierungen unauffaellig, ist das ein Positivergebnis: Das

> cat("Instrument misst in beiden Sprachfassungen und ueber die geprueften\n")
Instrument misst in beiden Sprachfassungen und ueber die geprueften

> cat("Untergruppen hinweg dasselbe.\n")
Untergruppen hinweg dasselbe.

> save_tab(dif_lang,   "02_DIF_Sprachgruppe")
  geschrieben: 02_DIF_Sprachgruppe.csv 

> save_tab(dif_lang_p, "02_DIF_Sprachgruppe_Restscore")
  geschrieben: 02_DIF_Sprachgruppe_Restscore.csv 

> save_tab(dif_age,    "02_DIF_Alter")
  geschrieben: 02_DIF_Alter.csv 

> save_tab(dif_sex,    "02_DIF_Geschlecht")
  geschrieben: 02_DIF_Geschlecht.csv 

> save_tab(dif_urb,    "02_DIF_Wohnort")
  geschrieben: 02_DIF_Wohnort.csv 

> save_tab(summ,       "02_DIF_Zusammenfassung")
  geschrieben: 02_DIF_Zusammenfassung.csv 

> cat("\n=== Abgleich mit der Voranalyse ===\n")

=== Abgleich mit der Voranalyse ===

> cat(sprintf("Sprachgruppe, groesstes delta R2: berechnet %.4f, Voranalyse 0.008\n",
+             max(dif_lang$delta_R2, na.rm = TRUE)))
Sprachgruppe, groesstes delta R2: berechnet 0.0070, Voranalyse 0.008

> cat(sprintf("Sprachgruppe, kleinstes q:        berechnet %.3f, Voranalyse 0.079\n",
+             min(dif_lang$q_uniform, na.rm = TRUE)))
Sprachgruppe, kleinstes q:        berechnet 0.079, Voranalyse 0.079

> cat(sprintf("n der Primaeranalyse:             berechnet %d, Voranalyse 826\n",
+             sum(keep_lang)))
n der Primaeranalyse:             berechnet 826, Voranalyse 826

> end_log()

 ====================================================================== 
Ende: 2026-08-09 10:39:09 
