Projektseminar

Datenaufbereitung III

Julius Klingelhoefer

2022-11-30

Erhebungs-Updates

Von mir

ggplotly(daily_plot)

Stand 2022-11-30 16:14:51

Von mir

Stand 2022-11-30 16:14:52

Von mir II

  • Flyer:

  • WiSo-Studierendenverteiler:

    • > 100 Anmeldungen

    • E-Mail wurde gestern versendet

Von Ihnen?

  • Wie lief es bei der Rekrutierung?

  • Welche Maßnahmen haben Sie durchgeführt?

  • Welche Rekrutierung war besonders erfolgreich?

Arbeitsauftrag

  1. Reflektieren Sie Ihre Rekrutierungsstrategie:
    1. Welche waren erfolgreich, welche weniger?

    2. Welche könenn noch ausgeweitet werden?

  2. Planen Sie Ihre Strategie für die aktuelle Woche

Ziel der heutigen R-Lektionen

Praktische Anwendung der Grundlagen der Variablenbearbeitung (bzw. der zentralen Befehle) der letzten Sitzungen im Kontext komplexer Transformationen

  • Überprüfung der Compliance

  • Überprüfung der Variable time_rsi auf Outlier

Filtern nach Probes

  • Wie wissen wir ob es eine (vollständige) Probe handelt?

  • ➡️ filter()

dl %>% 
  filter(
    form == "a Situational Survey" | form == "b End of Day"
  )%>% 
  summary()
       id          probe_time        date_day_hm        probe_number_daily
 Min.   :   1.0   Length:12508       Length:12508       Min.   :1.000     
 1st Qu.: 146.0   Class :character   Class :character   1st Qu.:2.000     
 Median : 809.0   Mode  :character   Mode  :character   Median :3.000     
 Mean   : 560.2                                         Mean   :3.051     
 3rd Qu.: 927.0                                         3rd Qu.:4.000     
 Max.   :1042.0                                         Max.   :5.000     
                                                        NA's   :19        
  participant      trigger          valid_probe        date_day         
 Min.   :  3.0   Length:12508       Mode :logical   Min.   :2022-11-15  
 1st Qu.:167.0   Class :character   FALSE:271       1st Qu.:2022-11-19  
 Median :333.0   Mode  :character   TRUE :12237     Median :2022-11-23  
 Mean   :329.2                                      Mean   :2022-11-22  
 3rd Qu.:479.0                                      3rd Qu.:2022-11-26  
 Max.   :642.0                                      Max.   :2022-11-30  
                                                                        
   time_day          trigger_date                   
 Length:12508       Min.   :2022-11-15 09:00:16.00  
 Class :character   1st Qu.:2022-11-19 18:07:19.75  
 Mode  :character   Median :2022-11-23 15:16:20.50  
                    Mean   :2022-11-23 07:55:21.34  
                    3rd Qu.:2022-11-26 17:38:08.50  
                    Max.   :2022-11-30 20:57:30.00  
                                                    
  trigger_time                    trigger_counter      form          
 Min.   :2022-11-15 09:00:16.00   Min.   :  3.00   Length:12508      
 1st Qu.:2022-11-19 18:07:19.75   1st Qu.: 20.00   Class :character  
 Median :2022-11-23 15:16:20.50   Median : 38.00   Mode  :character  
 Mean   :2022-11-23 07:55:21.34   Mean   : 41.52                     
 3rd Qu.:2022-11-26 17:38:08.50   3rd Qu.: 58.00                     
 Max.   :2022-11-30 20:57:30.00   Max.   :233.00                     
                                                                     
 duration_start   duration_end   form_start_date                 
 Min.   :NA      Min.   :NA      Min.   :2022-11-15 09:00:50.00  
 1st Qu.:NA      1st Qu.:NA      1st Qu.:2022-11-19 18:14:58.25  
 Median :NA      Median :NA      Median :2022-11-23 15:31:57.50  
 Mean   :NaN     Mean   :NaN     Mean   :2022-11-23 08:01:15.73  
 3rd Qu.:NA      3rd Qu.:NA      3rd Qu.:2022-11-26 17:40:51.00  
 Max.   :NA      Max.   :NA      Max.   :2022-11-30 20:57:34.00  
 NA's   :12508   NA's   :12508                                   
 form_start_time                  form_finish_date                
 Min.   :2022-11-15 09:00:50.00   Min.   :2022-11-15 09:04:04.00  
 1st Qu.:2022-11-19 18:14:58.25   1st Qu.:2022-11-19 18:16:11.50  
 Median :2022-11-23 15:31:57.50   Median :2022-11-23 15:32:45.50  
 Mean   :2022-11-23 08:01:15.73   Mean   :2022-11-23 08:02:32.44  
 3rd Qu.:2022-11-26 17:40:51.00   3rd Qu.:2022-11-26 17:41:37.25  
 Max.   :2022-11-30 20:57:34.00   Max.   :2022-11-30 20:58:05.00  
                                                                  
 form_finish_time                 form_upload_date                
 Min.   :2022-11-15 09:04:04.00   Min.   :2022-11-15 08:48:34.00  
 1st Qu.:2022-11-19 18:16:11.50   1st Qu.:2022-11-19 18:32:41.75  
 Median :2022-11-23 15:32:45.50   Median :2022-11-23 16:31:41.00  
 Mean   :2022-11-23 08:02:32.44   Mean   :2022-11-23 08:12:24.75  
 3rd Qu.:2022-11-26 17:41:37.25   3rd Qu.:2022-11-26 17:42:16.75  
 Max.   :2022-11-30 20:58:05.00   Max.   :2022-11-30 15:36:49.00  
                                                                  
 form_upload_time                   missing              wb_ge      
 Min.   :2022-11-15 08:48:34.00   Length:12508       Min.   :1.000  
 1st Qu.:2022-11-19 18:32:41.75   Class :character   1st Qu.:4.000  
 Median :2022-11-23 16:31:41.00   Mode  :character   Median :5.000  
 Mean   :2022-11-23 08:12:24.75                      Mean   :5.022  
 3rd Qu.:2022-11-26 17:42:16.75                      3rd Qu.:6.000  
 Max.   :2022-11-30 15:36:49.00                      Max.   :7.000  
                                                     NA's   :32     
   wb_energy       wb_stress       wb_connect        procra     
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:1.000   1st Qu.:3.000   1st Qu.:1.000  
 Median :4.000   Median :2.000   Median :4.000   Median :1.000  
 Mean   :3.998   Mean   :2.757   Mean   :3.999   Mean   :2.276  
 3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:5.000   3rd Qu.:3.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :45      NA's   :45      NA's   :46      NA's   :56     
 screentime_work  screentime_leisure    disco_1          disco_2      
 Min.   :  0.00   Min.   :  0.00     Min.   :0.0000   Min.   :0.0000  
 1st Qu.:  0.00   1st Qu.: 10.00     1st Qu.:0.0000   1st Qu.:0.0000  
 Median :  2.00   Median : 23.00     Median :0.0000   Median :0.0000  
 Mean   : 23.06   Mean   : 33.29     Mean   :0.2905   Mean   :0.3726  
 3rd Qu.: 34.00   3rd Qu.: 50.00     3rd Qu.:1.0000   3rd Qu.:1.0000  
 Max.   :120.00   Max.   :120.00     Max.   :1.0000   Max.   :1.0000  
 NA's   :60       NA's   :63         NA's   :83       NA's   :83      
    disco_3          disco_4          disco_5         disco_6      
 Min.   :0.0000   Min.   :0.0000   Min.   :0.000   Min.   :0.0000  
 1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.000   1st Qu.:0.0000  
 Median :0.0000   Median :0.0000   Median :0.000   Median :0.0000  
 Mean   :0.3923   Mean   :0.4101   Mean   :0.421   Mean   :0.4147  
 3rd Qu.:1.0000   3rd Qu.:1.0000   3rd Qu.:1.000   3rd Qu.:1.0000  
 Max.   :1.0000   Max.   :1.0000   Max.   :1.000   Max.   :1.0000  
 NA's   :83       NA's   :83       NA's   :83      NA's   :83      
    disco_sd     motivation_distraction motivation_wellbeing motivation_social
 Min.   :1.000   Min.   :1.000          Min.   :1.000        Min.   :1.000    
 1st Qu.:5.000   1st Qu.:4.000          1st Qu.:1.000        1st Qu.:2.000    
 Median :6.000   Median :6.000          Median :3.000        Median :5.000    
 Mean   :5.809   Mean   :5.006          Mean   :3.647        Mean   :4.546    
 3rd Qu.:7.000   3rd Qu.:7.000          3rd Qu.:6.000        3rd Qu.:7.000    
 Max.   :7.000   Max.   :7.000          Max.   :7.000        Max.   :7.000    
 NA's   :5241    NA's   :5245           NA's   :5246         NA's   :5249     
  ns_autonomy    ns_competence   ns_relatedness  media_category_1
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :0.000   
 1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:0.000   
 Median :4.500   Median :4.000   Median :4.000   Median :1.000   
 Mean   :4.338   Mean   :4.399   Mean   :4.315   Mean   :0.528   
 3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:1.000   
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :1.000   
 NA's   :7362    NA's   :7364    NA's   :7364    NA's   :7370    
 media_category_2 media_category_3 media_category_4 media_category_5
 Min.   :0.000    Min.   :0.000    Min.   :0.00     Min.   :0.000   
 1st Qu.:0.000    1st Qu.:0.000    1st Qu.:0.00     1st Qu.:0.000   
 Median :0.000    Median :1.000    Median :0.00     Median :0.000   
 Mean   :0.139    Mean   :0.688    Mean   :0.38     Mean   :0.174   
 3rd Qu.:0.000    3rd Qu.:1.000    3rd Qu.:1.00     3rd Qu.:0.000   
 Max.   :1.000    Max.   :1.000    Max.   :1.00     Max.   :1.000   
 NA's   :7370     NA's   :7370     NA's   :7370     NA's   :7370    
 media_category_6 media_category_7   goal_conf      missed_alarm  
 Min.   :0.000    Min.   :0.000    Min.   :1.000   Min.   :1.000  
 1st Qu.:0.000    1st Qu.:0.000    1st Qu.:1.000   1st Qu.:1.000  
 Median :0.000    Median :0.000    Median :3.000   Median :2.000  
 Mean   :0.462    Mean   :0.115    Mean   :3.161   Mean   :1.574  
 3rd Qu.:1.000    3rd Qu.:0.000    3rd Qu.:5.000   3rd Qu.:2.000  
 Max.   :1.000    Max.   :1.000    Max.   :7.000   Max.   :2.000  
 NA's   :7370     NA's   :7370     NA's   :118     NA's   :9881   
  missed_time    disco_1_daily_alarm_1 disco_1_daily_alarm_2
 Min.   :1.000   Min.   :0.000         Min.   :0.000        
 1st Qu.:1.000   1st Qu.:1.000         1st Qu.:0.000        
 Median :1.000   Median :1.000         Median :0.000        
 Mean   :1.427   Mean   :0.846         Mean   :0.495        
 3rd Qu.:2.000   3rd Qu.:1.000         3rd Qu.:1.000        
 Max.   :2.000   Max.   :1.000         Max.   :1.000        
 NA's   :9881    NA's   :11390         NA's   :11390        
 disco_1_daily_alarm_3 disco_1_daily_alarm_4 disco_1_daily_alarm_5
 Min.   :0.000         Min.   :0.000         Min.   :0.000        
 1st Qu.:0.000         1st Qu.:0.000         1st Qu.:0.000        
 Median :0.000         Median :0.000         Median :0.000        
 Mean   :0.428         Mean   :0.445         Mean   :0.396        
 3rd Qu.:1.000         3rd Qu.:1.000         3rd Qu.:1.000        
 Max.   :1.000         Max.   :1.000         Max.   :1.000        
 NA's   :11390         NA's   :11390         NA's   :11390        
 disco_1_daily_alarm_6 disco_1_daily_time_1 disco_1_daily_time_2
 Min.   :0.000         Min.   :0.000        Min.   :0.00        
 1st Qu.:0.000         1st Qu.:1.000        1st Qu.:0.00        
 Median :0.000         Median :1.000        Median :1.00        
 Mean   :0.082         Mean   :0.841        Mean   :0.74        
 3rd Qu.:0.000         3rd Qu.:1.000        3rd Qu.:1.00        
 Max.   :1.000         Max.   :1.000        Max.   :1.00        
 NA's   :11390         NA's   :11007        NA's   :11007       
 disco_1_daily_time_3 disco_1_daily_time_4 disco_1_daily_time_5
 Min.   :0.000        Min.   :0.000        Min.   :0.000       
 1st Qu.:0.000        1st Qu.:0.000        1st Qu.:0.000       
 Median :1.000        Median :1.000        Median :1.000       
 Mean   :0.656        Mean   :0.676        Mean   :0.628       
 3rd Qu.:1.000        3rd Qu.:1.000        3rd Qu.:1.000       
 Max.   :1.000        Max.   :1.000        Max.   :1.000       
 NA's   :11007        NA's   :11007        NA's   :11007       
 disco_1_daily_time_6 motivation_distraction_day motivation_well_being_day
 Min.   :0.000        Min.   :1.000              Min.   :1.000            
 1st Qu.:0.000        1st Qu.:5.000              1st Qu.:2.000            
 Median :0.000        Median :6.000              Median :5.000            
 Mean   :0.031        Mean   :5.382              Mean   :4.269            
 3rd Qu.:0.000        3rd Qu.:7.000              3rd Qu.:6.000            
 Max.   :1.000        Max.   :7.000              Max.   :7.000            
 NA's   :11007        NA's   :10739              NA's   :10739            
 motivation_social_day conscientiousness disco_thoughts  final_feedback    
 Min.   :1.000         Min.   : NA       Min.   : NA     Length:12508      
 1st Qu.:4.000         1st Qu.: NA       1st Qu.: NA     Class :character  
 Median :6.000         Median : NA       Median : NA     Mode  :character  
 Mean   :5.218         Mean   :NaN       Mean   :NaN                       
 3rd Qu.:7.000         3rd Qu.: NA       3rd Qu.: NA                       
 Max.   :7.000         Max.   : NA       Max.   : NA                       
 NA's   :10739         NA's   :12508     NA's   :12508                     
 participation_n_1 participation_n text_comment       reward_choice  
 Min.   : NA       Min.   : NA     Length:12508       Min.   : NA    
 1st Qu.: NA       1st Qu.: NA     Class :character   1st Qu.: NA    
 Median : NA       Median : NA     Mode  :character   Median : NA    
 Mean   :NaN       Mean   :NaN                        Mean   :NaN    
 3rd Qu.: NA       3rd Qu.: NA                        3rd Qu.: NA    
 Max.   : NA       Max.   : NA                        Max.   : NA    
 NA's   :12508     NA's   :12508                      NA's   :12508  
   bold_check       feedback      feedback_pin   feedback_study_results
 Min.   : NA     Min.   : NA     Min.   : NA     Min.   : NA           
 1st Qu.: NA     1st Qu.: NA     1st Qu.: NA     1st Qu.: NA           
 Median : NA     Median : NA     Median : NA     Median : NA           
 Mean   :NaN     Mean   :NaN     Mean   :NaN     Mean   :NaN           
 3rd Qu.: NA     3rd Qu.: NA     3rd Qu.: NA     3rd Qu.: NA           
 Max.   : NA     Max.   : NA     Max.   : NA     Max.   : NA           
 NA's   :12508   NA's   :12508   NA's   :12508   NA's   :12508         
     day_n        daily_forms    participation_number   final_day    
 Min.   : NA     Min.   : NA     Min.   : NA          Min.   : NA    
 1st Qu.: NA     1st Qu.: NA     1st Qu.: NA          1st Qu.: NA    
 Median : NA     Median : NA     Median : NA          Median : NA    
 Mean   :NaN     Mean   :NaN     Mean   :NaN          Mean   :NaN    
 3rd Qu.: NA     3rd Qu.: NA     3rd Qu.: NA          3rd Qu.: NA    
 Max.   : NA     Max.   : NA     Max.   : NA          Max.   : NA    
 NA's   :12508   NA's   :12508   NA's   :12508        NA's   :12508  
    finished     end_of_day_fillout   day_min            day_newest        
 Min.   : NA     Min.   : NA        Length:12508       Min.   :2022-11-15  
 1st Qu.: NA     1st Qu.: NA        Class :character   1st Qu.:2022-11-28  
 Median : NA     Median : NA        Mode  :character   Median :2022-11-29  
 Mean   :NaN     Mean   :NaN                           Mean   :2022-11-28  
 3rd Qu.: NA     3rd Qu.: NA                           3rd Qu.:2022-11-30  
 Max.   : NA     Max.   : NA                           Max.   :2022-11-30  
 NA's   :12508   NA's   :12508                                             
   day_start           logging           case_pre     serial_pre       
 Min.   :2022-11-15   Mode :logical   Min.   : 410   Length:12508      
 1st Qu.:2022-11-15   FALSE:5719      1st Qu.: 708   Class :character  
 Median :2022-11-16   TRUE :6789      Median : 956   Mode  :character  
 Mean   :2022-11-17                   Mean   :1048                     
 3rd Qu.:2022-11-22                   3rd Qu.:1267                     
 Max.   :2022-11-28                   Max.   :2368                     
                                                                       
 ref_pre        questnnr_pre         mode_pre        
 Mode:logical   Length:12508       Length:12508      
 NA's:12508     Class :character   Class :character  
                Mode  :character   Mode  :character  
                                                     
                                                     
                                                     
                                                     
  started_pre                    availability_preference_01_pre
 Min.   :2022-11-14 08:04:43.0   Min.   :1.000                 
 1st Qu.:2022-11-14 12:06:00.0   1st Qu.:2.000                 
 Median :2022-11-15 08:32:34.0   Median :4.000                 
 Mean   :2022-11-16 22:48:28.7   Mean   :3.687                 
 3rd Qu.:2022-11-21 09:16:20.0   3rd Qu.:5.000                 
 Max.   :2022-11-27 19:08:06.0   Max.   :7.000                 
                                 NA's   :54                    
 availability_preference_02_pre availability_preference_03_pre
 Min.   :1.000                  Min.   :1.00                  
 1st Qu.:3.000                  1st Qu.:2.00                  
 Median :5.000                  Median :3.00                  
 Mean   :4.409                  Mean   :3.12                  
 3rd Qu.:6.000                  3rd Qu.:4.00                  
 Max.   :7.000                  Max.   :7.00                  
 NA's   :54                     NA's   :54                    
 availability_preference_04_pre disco_tech_w_1_pre disco_tech_w_2_pre
 Min.   :1.000                  Min.   :1.000      Min.   :1.00      
 1st Qu.:2.000                  1st Qu.:1.000      1st Qu.:1.00      
 Median :4.000                  Median :2.000      Median :1.00      
 Mean   :3.694                  Mean   :2.908      Mean   :1.51      
 3rd Qu.:5.000                  3rd Qu.:5.000      3rd Qu.:1.00      
 Max.   :7.000                  Max.   :7.000      Max.   :7.00      
 NA's   :54                     NA's   :54         NA's   :54        
 disco_tech_w_3_pre disco_tech_w_4_pre disco_tech_w_5_pre disco_tech_w_6_pre
 Min.   :1.000      Min.   :1.000      Min.   :1.000      Min.   :1.000     
 1st Qu.:1.000      1st Qu.:1.000      1st Qu.:2.000      1st Qu.:1.000     
 Median :1.000      Median :1.000      Median :3.000      Median :2.000     
 Mean   :1.777      Mean   :1.609      Mean   :3.443      Mean   :1.899     
 3rd Qu.:2.000      3rd Qu.:1.000      3rd Qu.:5.000      3rd Qu.:2.000     
 Max.   :7.000      Max.   :7.000      Max.   :7.000      Max.   :7.000     
 NA's   :54         NA's   :54         NA's   :54         NA's   :54        
 disco_level_w_1_pre disco_level_w_2_pre disco_level_w_3_pre
 Min.   :1.000       Min.   :1.00        Min.   :1.000      
 1st Qu.:1.000       1st Qu.:1.00        1st Qu.:1.000      
 Median :2.000       Median :2.00        Median :1.000      
 Mean   :2.127       Mean   :2.34        Mean   :1.728      
 3rd Qu.:3.000       3rd Qu.:3.00        3rd Qu.:2.000      
 Max.   :7.000       Max.   :7.00        Max.   :7.000      
                                                            
 disco_level_w_4_pre disco_level_w_5_pre disco_level_w_6_pre disco_thoughts_pre
 Min.   :1.000       Min.   :1.000       Min.   :1.000       Min.   :1.000     
 1st Qu.:1.000       1st Qu.:1.000       1st Qu.:1.000       1st Qu.:2.000     
 Median :3.000       Median :2.000       Median :1.000       Median :3.000     
 Mean   :2.873       Mean   :2.544       Mean   :1.781       Mean   :3.427     
 3rd Qu.:4.000       3rd Qu.:4.000       3rd Qu.:1.000       3rd Qu.:5.000     
 Max.   :7.000       Max.   :7.000       Max.   :7.000       Max.   :7.000     
                                         NA's   :9085                          
 disco_practice_other_pre disco_context_text_pre disco_context_1_pre
 Length:12508             Length:12508           Min.   :1.000      
 Class :character         Class :character       1st Qu.:1.000      
 Mode  :character         Mode  :character       Median :2.000      
                                                 Mean   :2.342      
                                                 3rd Qu.:3.000      
                                                 Max.   :7.000      
                                                 NA's   :132        
 disco_context_2_pre disco_context_3_pre disco_context_4_pre
 Min.   :1.000       Min.   :1.000       Min.   :1.00       
 1st Qu.:5.000       1st Qu.:5.000       1st Qu.:1.00       
 Median :6.000       Median :6.000       Median :2.00       
 Mean   :5.945       Mean   :5.628       Mean   :2.86       
 3rd Qu.:7.000       3rd Qu.:7.000       3rd Qu.:4.00       
 Max.   :7.000       Max.   :7.000       Max.   :7.00       
 NA's   :139         NA's   :174         NA's   :509        
 disco_context_5_pre disco_context_6_pre disco_context_7_pre
 Min.   :1.000       Min.   :1.000       Min.   :1.000      
 1st Qu.:1.000       1st Qu.:5.000       1st Qu.:5.000      
 Median :2.000       Median :7.000       Median :6.000      
 Mean   :3.089       Mean   :6.006       Mean   :5.682      
 3rd Qu.:4.000       3rd Qu.:7.000       3rd Qu.:7.000      
 Max.   :7.000       Max.   :7.000       Max.   :7.000      
 NA's   :106         NA's   :1792        NA's   :1187       
 disco_context_8_pre disco_context_9_pre disco_context_10_pre
 Min.   :1.000       Min.   :1.000       Min.   :1.000       
 1st Qu.:4.000       1st Qu.:5.000       1st Qu.:4.000       
 Median :5.000       Median :6.000       Median :5.000       
 Mean   :5.014       Mean   :5.616       Mean   :5.259       
 3rd Qu.:6.000       3rd Qu.:7.000       3rd Qu.:7.000       
 Max.   :7.000       Max.   :7.000       Max.   :7.000       
 NA's   :1340        NA's   :1489        NA's   :547         
 disco_context_11_pre disco_context_other_pre logging_choice_pre
 Min.   :1.000        Min.   :1.00            Min.   :1.000     
 1st Qu.:3.000        1st Qu.:1.00            1st Qu.:1.000     
 Median :4.000        Median :6.00            Median :1.000     
 Mean   :4.081        Mean   :4.78            Mean   :1.457     
 3rd Qu.:5.000        3rd Qu.:7.00            3rd Qu.:2.000     
 Max.   :7.000        Max.   :7.00            Max.   :2.000     
 NA's   :680          NA's   :11504                             
 comment_pre_survey_pre  fomo_01_pre     fomo_02_pre    fomo_03_pre   
 Length:12508           Min.   :1.000   Min.   :1.00   Min.   :1.000  
 Class :character       1st Qu.:1.000   1st Qu.:1.00   1st Qu.:1.000  
 Mode  :character       Median :2.000   Median :2.00   Median :1.000  
                        Mean   :3.156   Mean   :2.62   Mean   :1.645  
                        3rd Qu.:5.000   3rd Qu.:4.00   3rd Qu.:2.000  
                        Max.   :7.000   Max.   :7.00   Max.   :7.000  
                        NA's   :54      NA's   :54     NA's   :54     
  fomo_04_pre     fomo_05_pre     fomo_06_pre     fomo_07_pre   
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:2.000   1st Qu.:1.000   1st Qu.:3.000   1st Qu.:1.000  
 Median :4.000   Median :2.000   Median :5.000   Median :2.000  
 Mean   :3.736   Mean   :2.891   Mean   :4.222   Mean   :2.477  
 3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:6.000   3rd Qu.:3.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54     
  fomo_08_pre     fomo_09_pre    fomo_10_pre     consent_pre  ic03_04_pre
 Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :4    Min.   :2   
 1st Qu.:5.000   1st Qu.:1.00   1st Qu.:2.000   1st Qu.:4    1st Qu.:2   
 Median :6.000   Median :2.00   Median :3.000   Median :4    Median :2   
 Mean   :5.902   Mean   :2.68   Mean   :3.121   Mean   :4    Mean   :2   
 3rd Qu.:7.000   3rd Qu.:4.00   3rd Qu.:5.000   3rd Qu.:4    3rd Qu.:2   
 Max.   :7.000   Max.   :7.00   Max.   :7.000   Max.   :4    Max.   :2   
 NA's   :54      NA's   :54     NA's   :54                               
  ic03_03_pre  ic03_01_pre  ic03_02_pre  android_pre consent_part_2_pre
 Min.   :2    Min.   :2    Min.   :2    Min.   :1    Min.   :1         
 1st Qu.:2    1st Qu.:2    1st Qu.:2    1st Qu.:1    1st Qu.:1         
 Median :2    Median :2    Median :2    Median :1    Median :1         
 Mean   :2    Mean   :2    Mean   :2    Mean   :1    Mean   :1         
 3rd Qu.:2    3rd Qu.:2    3rd Qu.:2    3rd Qu.:1    3rd Qu.:1         
 Max.   :2    Max.   :2    Max.   :2    Max.   :1    Max.   :1         
                                                                       
 md_work_seconds_pre md_private_seconds_pre mindfulness_01_pre
 Min.   :    1       Min.   : 1042          Min.   :1.000     
 1st Qu.: 5206       1st Qu.: 9370          1st Qu.:3.000     
 Median :13013       Median :15095          Median :4.000     
 Mean   :14543       Mean   :18756          Mean   :4.275     
 3rd Qu.:22902       3rd Qu.:21861          3rd Qu.:6.000     
 Max.   :86401       Max.   :86401          Max.   :7.000     
 NA's   :54                                 NA's   :54        
 mindfulness_02_pre mindfulness_03_pre mindfulness_04_pre mindfulness_05_pre
 Min.   :1.000      Min.   :1.000      Min.   :1.000      Min.   :1.00      
 1st Qu.:3.000      1st Qu.:3.000      1st Qu.:2.000      1st Qu.:3.00      
 Median :5.000      Median :5.000      Median :4.000      Median :4.00      
 Mean   :4.404      Mean   :4.628      Mean   :3.924      Mean   :4.13      
 3rd Qu.:6.000      3rd Qu.:6.000      3rd Qu.:6.000      3rd Qu.:6.00      
 Max.   :7.000      Max.   :7.000      Max.   :7.000      Max.   :7.00      
 NA's   :54         NA's   :54         NA's   :54         NA's   :54        
   pdo_01_pre      pdo_02_pre      pdo_03_pre      rsd_01_pre   
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000  
 Median :5.000   Median :5.000   Median :5.000   Median :5.000  
 Mean   :4.498   Mean   :4.693   Mean   :4.277   Mean   :4.705  
 3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:7.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54     
   rsd_02_pre      rsd_03_pre      rsd_04_pre      rsd_05_pre      rsd_06_pre  
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.00  
 1st Qu.:1.000   1st Qu.:6.000   1st Qu.:3.000   1st Qu.:5.000   1st Qu.:5.00  
 Median :2.000   Median :6.000   Median :4.000   Median :6.000   Median :6.00  
 Mean   :3.157   Mean   :6.028   Mean   :4.136   Mean   :5.495   Mean   :5.62  
 3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:7.00  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.00  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54      NA's   :54    
  sc_res_1_pre    sc_res_3_pre    sc_imp_1_pre    sc_res_4_pre  
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000  
 Median :4.000   Median :3.000   Median :3.000   Median :3.000  
 Mean   :3.874   Mean   :3.361   Mean   :3.324   Mean   :3.332  
 3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:5.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54     
  sc_res_2_pre    sc_imp_2_pre    sc_imp_3_pre    sc_imp_4_pre  
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:2.000   1st Qu.:3.000   1st Qu.:4.000  
 Median :4.000   Median :3.000   Median :4.000   Median :5.000  
 Mean   :3.838   Mean   :3.667   Mean   :3.947   Mean   :5.062  
 3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:6.000   3rd Qu.:6.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54     
 sd_gender_pre   sd_gender_custom_pre    age_pre      work_hours_pre 
 Min.   :1.000   Length:12508         Min.   : 1.00   Min.   :1.000  
 1st Qu.:1.000   Class :character     1st Qu.:23.00   1st Qu.:2.000  
 Median :2.000   Mode  :character     Median :26.00   Median :4.000  
 Mean   :1.701                        Mean   :26.41   Mean   :3.627  
 3rd Qu.:2.000                        3rd Qu.:30.00   3rd Qu.:5.000  
 Max.   :4.000                        Max.   :64.00   Max.   :7.000  
 NA's   :54                           NA's   :54      NA's   :54     
   sd_edu_pre    sd_education_text_pre sd_living_arrangement_pre
 Min.   :1.000   Length:12508          Min.   :1.000            
 1st Qu.:4.000   Class :character      1st Qu.:2.000            
 Median :6.000   Mode  :character      Median :3.000            
 Mean   :5.396                         Mean   :3.064            
 3rd Qu.:7.000                         3rd Qu.:5.000            
 Max.   :9.000                         Max.   :7.000            
 NA's   :54                            NA's   :54               
 sd_living_not_own_kids_pre sd_living_own_kids_pre
 Min.   :0.000              Min.   :1.000         
 1st Qu.:0.000              1st Qu.:1.000         
 Median :0.000              Median :1.000         
 Mean   :0.625              Mean   :1.325         
 3rd Qu.:1.000              3rd Qu.:2.000         
 Max.   :4.000              Max.   :2.000         
 NA's   :10213              NA's   :11543         
 sd_living_arrangement_text_pre sd_household_size_pre sd_occupation_pre
 Length:12508                   Min.   :1.000         Min.   : 1.000   
 Class :character               1st Qu.:2.000         1st Qu.: 3.000   
 Mode  :character               Median :2.000         Median : 3.000   
                                Mean   :2.517         Mean   : 4.206   
                                3rd Qu.:3.000         3rd Qu.: 5.000   
                                Max.   :7.000         Max.   :11.000   
                                NA's   :54            NA's   :54       
 sd_occupation_text_pre device_type_pre   swl_01_pre      swl_02_pre   
 Length:12508           Min.   :1.000   Min.   :1.000   Min.   :1.000  
 Class :character       1st Qu.:1.000   1st Qu.:3.000   1st Qu.:5.000  
 Mode  :character       Median :5.000   Median :5.000   Median :5.000  
                        Mean   :3.103   Mean   :4.564   Mean   :5.197  
                        3rd Qu.:5.000   3rd Qu.:6.000   3rd Qu.:6.000  
                        Max.   :5.000   Max.   :7.000   Max.   :7.000  
                                        NA's   :54      NA's   :54     
   swl_03_pre      swl_04_pre      swl_05_pre      pa_01_pre    
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:4.000   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000  
 Median :5.000   Median :5.000   Median :5.000   Median :5.000  
 Mean   :5.082   Mean   :4.655   Mean   :4.349   Mean   :4.529  
 3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54      NA's   :54     
   pa_02_pre       pa_03_pre       pa_04_pre       pa_05_pre      na_01_pre    
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.00   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:3.000   1st Qu.:3.000   1st Qu.:4.00   1st Qu.:2.000  
 Median :4.000   Median :4.000   Median :5.000   Median :5.00   Median :3.000  
 Mean   :3.938   Mean   :4.243   Mean   :4.426   Mean   :4.57   Mean   :3.103  
 3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:6.00   3rd Qu.:4.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.00   Max.   :7.000  
 NA's   :54      NA's   :54      NA's   :54                     NA's   :54     
   na_02_pre       na_03_pre      na_04_pre       na_05_pre    
 Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000  
 1st Qu.:1.000   1st Qu.:1.00   1st Qu.:2.000   1st Qu.:2.000  
 Median :2.000   Median :2.00   Median :3.000   Median :2.000  
 Mean   :1.939   Mean   :2.13   Mean   :3.655   Mean   :3.025  
 3rd Qu.:2.000   3rd Qu.:3.00   3rd Qu.:5.000   3rd Qu.:5.000  
 Max.   :7.000   Max.   :7.00   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :54     NA's   :54      NA's   :54     
 positive_arousal_pre negative_arousal_pre connectedness_pre   wb_ge_pre    
 Min.   :1.000        Min.   :1.000        Min.   :1.000     Min.   :1.000  
 1st Qu.:3.000        1st Qu.:3.000        1st Qu.:4.000     1st Qu.:3.000  
 Median :4.000        Median :5.000        Median :5.000     Median :5.000  
 Mean   :3.911        Mean   :4.572        Mean   :4.671     Mean   :4.625  
 3rd Qu.:5.000        3rd Qu.:6.000        3rd Qu.:6.000     3rd Qu.:6.000  
 Max.   :7.000        Max.   :7.000        Max.   :7.000     Max.   :7.000  
 NA's   :54           NA's   :54           NA's   :54        NA's   :8      
 procra_01_pre   procra_02_pre   procra_03_pre   procra_04_pre  
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:2.000   1st Qu.:3.000   1st Qu.:2.000  
 Median :5.000   Median :4.000   Median :5.000   Median :4.000  
 Mean   :4.312   Mean   :3.916   Mean   :4.259   Mean   :3.835  
 3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000  
 Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
 NA's   :54      NA's   :94      NA's   :54      NA's   :94     
 procra_05_pre    time001_pre        time002_pre        time003_pre     
 Min.   :1.000   Min.   :    1.00   Min.   :     3.0   Min.   :   12.0  
 1st Qu.:3.000   1st Qu.:   14.00   1st Qu.:    22.0   1st Qu.:   52.0  
 Median :5.000   Median :   43.00   Median :    33.0   Median :   66.0  
 Mean   :4.267   Mean   :   80.11   Mean   :   341.4   Mean   :  415.4  
 3rd Qu.:6.000   3rd Qu.:   90.00   3rd Qu.:    54.0   3rd Qu.:   89.0  
 Max.   :7.000   Max.   :11227.00   Max.   :101818.0   Max.   :82086.0  
 NA's   :54                                                             
  time004_pre      time005_pre      time006_pre       time007_pre     
 Min.   :  3.00   Min.   :  4.00   Min.   :   7.00   Min.   :    7.0  
 1st Qu.: 22.00   1st Qu.: 40.00   1st Qu.:  45.00   1st Qu.:   51.0  
 Median : 30.00   Median : 50.00   Median :  58.00   Median :   66.0  
 Mean   : 36.95   Mean   : 61.07   Mean   :  93.97   Mean   :  105.9  
 3rd Qu.: 41.00   3rd Qu.: 69.00   3rd Qu.:  87.00   3rd Qu.:   90.0  
 Max.   :312.00   Max.   :446.00   Max.   :4404.00   Max.   :38525.0  
                                                                      
  time008_pre      time009_pre      time010_pre        time011_pre     
 Min.   :   3.0   Min.   :  4.00   Min.   :    2.00   Min.   :    3.0  
 1st Qu.:  36.0   1st Qu.: 18.00   1st Qu.:   13.00   1st Qu.:   31.0  
 Median :  49.0   Median : 24.00   Median :   17.00   Median :   39.0  
 Mean   :  75.6   Mean   : 32.01   Mean   :   82.46   Mean   :  150.3  
 3rd Qu.:  71.0   3rd Qu.: 34.00   3rd Qu.:   22.00   3rd Qu.:   50.0  
 Max.   :8762.0   Max.   :431.00   Max.   :13872.00   Max.   :18603.0  
                                                                       
  time012_pre     time013_pre       time014_pre       time015_pre    
 Min.   :    4   Min.   :    3.0   Min.   :    3.0   Min.   :  3.00  
 1st Qu.:   32   1st Qu.:   45.0   1st Qu.:   25.0   1st Qu.: 36.00  
 Median :   42   Median :   57.0   Median :   33.0   Median : 46.00  
 Mean   :  101   Mean   :  131.3   Mean   :  168.9   Mean   : 55.45  
 3rd Qu.:   56   3rd Qu.:   72.0   3rd Qu.:   43.0   3rd Qu.: 59.00  
 Max.   :11439   Max.   :83433.0   Max.   :49903.0   Max.   :603.00  
                                                                     
  time016_pre      time017_pre      time018_pre      time019_pre     
 Min.   :  6.00   Min.   :  4.00   Min.   :   8.0   Min.   :    3.0  
 1st Qu.: 12.00   1st Qu.: 26.00   1st Qu.:  53.0   1st Qu.:   36.0  
 Median : 16.00   Median : 39.00   Median :  83.0   Median :   62.0  
 Mean   : 19.11   Mean   : 45.26   Mean   : 106.4   Mean   :  138.1  
 3rd Qu.: 21.00   3rd Qu.: 51.00   3rd Qu.: 116.0   3rd Qu.:  105.0  
 Max.   :163.00   Max.   :538.00   Max.   :3137.0   Max.   :15553.0  
                                                                     
  time020_pre      time021_pre      time_sum_pre  mailsent_pre  
 Min.   :     8   Min.   :  1.00   Min.   : 153   Mode:logical  
 1st Qu.:   227   1st Qu.:  3.00   1st Qu.: 906   NA's:12508    
 Median :   308   Median :  3.00   Median :1138                 
 Mean   : 13725   Mean   : 14.24   Mean   :1192                 
 3rd Qu.:   456   3rd Qu.:  5.00   3rd Qu.:1419                 
 Max.   :949394   Max.   :452.00   Max.   :2755                 
 NA's   :3770     NA's   :4489                                  
  lastdata_pre                    finished_pre    q_viewer_pre  lastpage_pre 
 Min.   :2022-11-14 08:20:33.0   Min.   :0.000   Min.   :0     Min.   :19.0  
 1st Qu.:2022-11-14 12:41:24.0   1st Qu.:0.000   1st Qu.:0     1st Qu.:19.0  
 Median :2022-11-15 09:32:51.0   Median :1.000   Median :0     Median :21.0  
 Mean   :2022-11-17 00:10:51.0   Mean   :0.638   Mean   :0     Mean   :20.3  
 3rd Qu.:2022-11-21 09:35:11.0   3rd Qu.:1.000   3rd Qu.:0     3rd Qu.:21.0  
 Max.   :2022-11-27 19:16:03.0   Max.   :1.000   Max.   :0     Max.   :21.0  
                                                                             
  maxpage_pre     missing_pre     missrel_pre      time_rsi_pre  
 Min.   :19.00   Min.   : 0.00   Min.   : 0.000   Min.   :0.350  
 1st Qu.:19.00   1st Qu.: 3.00   1st Qu.: 0.000   1st Qu.:0.790  
 Median :21.00   Median : 4.00   Median : 1.000   Median :0.980  
 Mean   :20.34   Mean   : 4.34   Mean   : 1.069   Mean   :1.004  
 3rd Qu.:21.00   3rd Qu.: 5.00   3rd Qu.: 1.000   3rd Qu.:1.160  
 Max.   :21.00   Max.   :85.00   Max.   :85.000   Max.   :2.970  
                                                                 
  deg_time_pre     finished_on         final_q_filled  n_filled_out  
 Min.   :  0.00   Min.   :2022-11-28   Mode:logical   Min.   : 1.00  
 1st Qu.:  3.00   1st Qu.:2022-11-28   TRUE:7608      1st Qu.:33.00  
 Median :  8.00   Median :2022-11-29   NA's:4900      Median :46.00  
 Mean   : 13.01   Mean   :2022-11-30                  Mean   :43.81  
 3rd Qu.: 17.00   3rd Qu.:2022-12-05                  3rd Qu.:56.00  
 Max.   :299.00   Max.   :2022-12-11                  Max.   :68.00  
                  NA's   :85                                         
   date_diff     max_participation  total_valid     total_missed  
 Min.   : 1.00   Min.   : 5.00     Min.   : 1.00   Min.   :-1.00  
 1st Qu.: 9.00   1st Qu.:45.00     1st Qu.:33.00   1st Qu.: 9.00  
 Median :13.00   Median :65.00     Median :46.00   Median :15.00  
 Mean   :12.24   Mean   :61.19     Mean   :43.81   Mean   :17.38  
 3rd Qu.:14.00   3rd Qu.:70.00     3rd Qu.:56.00   3rd Qu.:23.00  
 Max.   :16.00   Max.   :80.00     Max.   :68.00   Max.   :70.00  
                                                                  
   compliance    
 Min.   :0.0250  
 1st Qu.:0.6133  
 Median :0.7333  
 Mean   :0.7115  
 3rd Qu.:0.8429  
 Max.   :1.0154  
                 

Auswahl von Variablen

  • ➡️ select()
x = dl %>% 
  select(id, disco_1:disco_5) 
    
colnames(x)
[1] "id"      "disco_1" "disco_2" "disco_3" "disco_4" "disco_5"

Berechnung von Mittelwerten, z. B. disconnection

x %>% summarise(
  across(
    disco_1:disco_5, mean, na.rm = T
  ))
# A tibble: 1 × 5
  disco_1 disco_2 disco_3 disco_4 disco_5
    <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
1   0.291   0.373   0.392   0.410   0.421

Frage:

Wie können wir den Mittelwert pro Person bekommen?

Berechnung von Mittelwerten pro Person

x %>% 
  group_by(id) %>% 
  summarise(
  across(
    disco_1:disco_5, mean, na.rm = T
  ))

Index erstellen

# dplyr
x %>% 
  rowwise() %>% 
  mutate(idx_disco = 
           mean(c_across(disco_1:disco_5), na.rm = T),
         .before = "disco_1") %>% 
  summary()
       id           idx_disco        disco_1         disco_2     
 Min.   :   1.0   Min.   :0.000   Min.   :0.000   Min.   :0.000  
 1st Qu.: 142.2   1st Qu.:0.000   1st Qu.:0.000   1st Qu.:0.000  
 Median : 788.0   Median :0.200   Median :0.000   Median :0.000  
 Mean   : 543.1   Mean   :0.377   Mean   :0.291   Mean   :0.373  
 3rd Qu.: 915.0   3rd Qu.:0.800   3rd Qu.:1.000   3rd Qu.:1.000  
 Max.   :1044.0   Max.   :1.000   Max.   :1.000   Max.   :1.000  
                  NA's   :11589   NA's   :11589   NA's   :11589  
    disco_3         disco_4         disco_5     
 Min.   :0.000   Min.   :0.00    Min.   :0.000  
 1st Qu.:0.000   1st Qu.:0.00    1st Qu.:0.000  
 Median :0.000   Median :0.00    Median :0.000  
 Mean   :0.392   Mean   :0.41    Mean   :0.421  
 3rd Qu.:1.000   3rd Qu.:1.00    3rd Qu.:1.000  
 Max.   :1.000   Max.   :1.00    Max.   :1.000  
 NA's   :11589   NA's   :11589   NA's   :11589  
#sjmisc
x %>% sjmisc::row_means(., disco_1:disco_5, n = Inf, var = "idx_disco") %>% 
  summary()
       id            disco_1         disco_2         disco_3     
 Min.   :   1.0   Min.   :0.000   Min.   :0.000   Min.   :0.000  
 1st Qu.: 142.2   1st Qu.:0.000   1st Qu.:0.000   1st Qu.:0.000  
 Median : 788.0   Median :0.000   Median :0.000   Median :0.000  
 Mean   : 543.1   Mean   :0.291   Mean   :0.373   Mean   :0.392  
 3rd Qu.: 915.0   3rd Qu.:1.000   3rd Qu.:1.000   3rd Qu.:1.000  
 Max.   :1044.0   Max.   :1.000   Max.   :1.000   Max.   :1.000  
                  NA's   :11589   NA's   :11589   NA's   :11589  
    disco_4         disco_5        idx_disco    
 Min.   :0.00    Min.   :0.000   Min.   :0.000  
 1st Qu.:0.00    1st Qu.:0.000   1st Qu.:0.000  
 Median :0.00    Median :0.000   Median :0.200  
 Mean   :0.41    Mean   :0.421   Mean   :0.377  
 3rd Qu.:1.00    3rd Qu.:1.000   3rd Qu.:0.800  
 Max.   :1.00    Max.   :1.000   Max.   :1.000  
 NA's   :11589   NA's   :11589   NA's   :11589  

Compliance prüfen

Überprüfung der Compliance

  • Compliance ist zentral für Power

  • Problem: Trade-Off zwischenCompliance und Fallzahl(verlust)

Berechnung von Compliance

  • Variable finished gibt an, ob eine Probe vollständig ist

  • Berechnung der Compliance benötigt Ermittliung der finished Variablen

dl %>% filter(form == "a Situational Survey" | form == "b End of Day") %>% 
  mutate(
  Complete_Probes = ifelse(
    is.na(missing),
    "finished",
    "not valid")
  ) %>% sjPlot::plot_frq(Complete_Probes)

Mindestanforderungen an Compliance

  • ESM Best Practices (letztes Semester): idealerweise >= 80%, mind. >= 75%

  • Disconnection Kontext: Wahrscheinlich etwas geringere Compliance, z. B. durch verzicht auf Smartphone

  • Betrachtung wie viele Personen >= 75%/60%/50% ausgefüllt haben

Wie könnten wir das machen?

Wie könnten wir das machen?

dl %>%
  filter(form == "a Situational Survey" | form == "b End of Day") %>% 
  group_by(id) %>% 
  summarise(
    c = sum(is.na(missing))/70
  ) %>% 
  mutate(
    c_c = 
      ifelse(
        c > .75,
        "> 75",
        ifelse(
          c>.6,
          "> .6",
          ifelse(
            c > .5,
            "> .5",
            "< .5"
          )
        )
      )
  ) %>% 
  sjPlot::plot_frq(
    c_c
  )

Achtung: Da die Studie erst eine Woche läuft, zeigt eine komplexere Berechnung die Compliance wahrscheinlich besser. S. GitHub für eine Darstellung basiert auf dem Datum und ausfüllbaren Probes.

lubridate

  • Umgehen mit Datum und Uhrzeit ist schwieriger als mit “simplen” Skalendaten

  • ➡️ lubridate-package kann helfen,

  • z. B.

lubridate::day(sample(dl$trigger_date, size = 1))
[1] 27

Ausfülldauer: time_rsi im Fokus

  • Hoher wert, wenn Teilnehmer:in vergleichsweise schnell war, niedriger Wert, wenn besonders langsam (</> Median)
x = dl %>% 
  group_by(id) %>% 
  summarise( # Note that this is related to the pre-survey
    time_rsi = mean(time_rsi_pre)
  )
boxplot(x$time_rsi)

Ausfülldauer der Probes

dl %>%
  filter(form == "a Situational Survey" | form == "b End of Day") %>% 
  mutate(
    dur = 
      ifelse(
        form_finish_date-form_start_date < 1000,
        form_finish_date-form_start_date,
        NA)
  ) %>% 
  ggpubr::ggboxplot(
    ., "id", "dur"
  )

Median der Ausfüldauer

dl %>%
  filter(form == "a Situational Survey" | form == "b End of Day") %>% 
  mutate(
    dur = form_finish_date-form_start_date
  ) %>% 
  ungroup() %>% 
  summarise(
    md = median(dur, na.rm = T)
  )
# A tibble: 1 × 1
  md     
  <drtn> 
1 57 secs

Arbeitsauftrag für die Sitzung

  1. Führen Sie Analysen zur Compliance durch
    1. Finden Sie heraus, wie hoch die durchschnittliche Compliance ist. Dabei zählen nur Situations- und Tagesabschlussfragebögen

    2. Stellen Sie die Compliance tabellarisch und/oder grafisch dar

  2. Identifizieren Sie Personen, die die Vorbefragung möglicherweise unaufmerksam ausgefüllt haben, da sie zu schnell waren (time_rsi)
  3. Optionale Bonusaufgabe: Treffen Sie eine Vorhersage darüber, wie viele Personen a) die mindest-compliance für die Belohnung erreichen weden und b) eine compliance von >= .75 erreichen

Lösung

1.1 Durchschnittliche Compliance

x = dl %>%
  filter(form == "a Situational Survey" | form == "b End of Day") %>% 
  group_by(id) %>% 
  summarise(c = sum(is.na(missing))/70) %>%
  ungroup()
# Note: 70 is the maximum amount. Thus, compliance is relatively low until the study is completed.
# For a better but more complicated overview see "compliance_overview.R" on GitHub.)
x %>%  summarise(compliance = mean(c))
# A tibble: 1 × 1
  compliance
       <dbl>
1      0.479

1.2 Tabellarische & Grafische Übersicht

# table
sjmisc::frq(x$c)
x <numeric> 
# total N=365 valid N=365 mean=0.48 sd=0.27

Value |  N | Raw % | Valid % | Cum. %
-------------------------------------
 0.01 | 10 |  2.74 |    2.74 |   2.74
 0.03 | 11 |  3.01 |    3.01 |   5.75
 0.04 |  7 |  1.92 |    1.92 |   7.67
 0.06 |  7 |  1.92 |    1.92 |   9.59
 0.07 |  1 |  0.27 |    0.27 |   9.86
 0.09 |  3 |  0.82 |    0.82 |  10.68
 0.10 |  4 |  1.10 |    1.10 |  11.78
 0.11 |  5 |  1.37 |    1.37 |  13.15
 0.13 |  6 |  1.64 |    1.64 |  14.79
 0.14 |  4 |  1.10 |    1.10 |  15.89
 0.16 |  4 |  1.10 |    1.10 |  16.99
 0.17 |  9 |  2.47 |    2.47 |  19.45
 0.19 |  4 |  1.10 |    1.10 |  20.55
 0.20 |  4 |  1.10 |    1.10 |  21.64
 0.21 |  2 |  0.55 |    0.55 |  22.19
 0.23 |  2 |  0.55 |    0.55 |  22.74
 0.24 |  5 |  1.37 |    1.37 |  24.11
 0.26 |  1 |  0.27 |    0.27 |  24.38
 0.27 |  5 |  1.37 |    1.37 |  25.75
 0.29 |  3 |  0.82 |    0.82 |  26.58
 0.30 |  5 |  1.37 |    1.37 |  27.95
 0.31 |  5 |  1.37 |    1.37 |  29.32
 0.33 |  3 |  0.82 |    0.82 |  30.14
 0.34 |  7 |  1.92 |    1.92 |  32.05
 0.36 |  7 |  1.92 |    1.92 |  33.97
 0.37 |  6 |  1.64 |    1.64 |  35.62
 0.39 |  5 |  1.37 |    1.37 |  36.99
 0.40 |  5 |  1.37 |    1.37 |  38.36
 0.41 |  8 |  2.19 |    2.19 |  40.55
 0.43 |  5 |  1.37 |    1.37 |  41.92
 0.44 |  8 |  2.19 |    2.19 |  44.11
 0.46 |  7 |  1.92 |    1.92 |  46.03
 0.47 |  8 |  2.19 |    2.19 |  48.22
 0.49 |  7 |  1.92 |    1.92 |  50.14
 0.50 |  4 |  1.10 |    1.10 |  51.23
 0.51 | 11 |  3.01 |    3.01 |  54.25
 0.53 |  5 |  1.37 |    1.37 |  55.62
 0.54 |  5 |  1.37 |    1.37 |  56.99
 0.56 | 10 |  2.74 |    2.74 |  59.73
 0.57 | 11 |  3.01 |    3.01 |  62.74
 0.59 |  4 |  1.10 |    1.10 |  63.84
 0.60 |  6 |  1.64 |    1.64 |  65.48
 0.61 |  9 |  2.47 |    2.47 |  67.95
 0.63 |  2 |  0.55 |    0.55 |  68.49
 0.64 |  4 |  1.10 |    1.10 |  69.59
 0.66 |  4 |  1.10 |    1.10 |  70.68
 0.67 |  3 |  0.82 |    0.82 |  71.51
 0.69 |  4 |  1.10 |    1.10 |  72.60
 0.70 |  8 |  2.19 |    2.19 |  74.79
 0.71 |  6 |  1.64 |    1.64 |  76.44
 0.73 | 10 |  2.74 |    2.74 |  79.18
 0.74 |  8 |  2.19 |    2.19 |  81.37
 0.76 |  6 |  1.64 |    1.64 |  83.01
 0.77 |  6 |  1.64 |    1.64 |  84.66
 0.79 |  1 |  0.27 |    0.27 |  84.93
 0.80 |  5 |  1.37 |    1.37 |  86.30
 0.81 |  7 |  1.92 |    1.92 |  88.22
 0.83 |  8 |  2.19 |    2.19 |  90.41
 0.84 |  6 |  1.64 |    1.64 |  92.05
 0.86 |  4 |  1.10 |    1.10 |  93.15
 0.87 |  5 |  1.37 |    1.37 |  94.52
 0.89 |  4 |  1.10 |    1.10 |  95.62
 0.90 |  2 |  0.55 |    0.55 |  96.16
 0.91 |  2 |  0.55 |    0.55 |  96.71
 0.93 |  7 |  1.92 |    1.92 |  98.63
 0.94 |  3 |  0.82 |    0.82 |  99.45
 0.97 |  2 |  0.55 |    0.55 | 100.00
 <NA> |  0 |  0.00 |    <NA> |   <NA>
hist(x$c)

2. Outlier bei der Ausfülldauer der Vorbefragung

x = dl %>% select(id, time_rsi_pre) %>%
  group_by(id) %>% summarise(id = mean(id), time_rsi = mean(time_rsi_pre)) 
out = boxplot(x$time_rsi)
out$out
  [1] 2.97 2.69 3.00 3.00 3.00 3.00 2.66 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00
 [16] 3.00 2.89 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 2.63 3.00 3.00 3.00 3.00
 [31] 3.00 2.78 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 2.89 3.00 3.00 3.00 2.91
 [46] 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 3.00 2.60 3.00
 [61] 3.00 3.00 3.00 2.60 3.00 3.00 3.00 2.57 3.00 3.00 3.00 3.00 3.00 3.00 3.00
 [76] 3.00 3.00 2.60 3.00 2.89 3.00 3.00 3.00 3.00 3.00 3.00 3.00 2.95 3.00 3.00
 [91] 2.86 3.00 2.65 2.60 3.00 3.00 3.00 2.70 2.85 2.79 3.00 3.00 3.00 2.89 2.89
[106] 2.58 3.00 3.00 2.71 2.60 3.00 3.00 2.57 2.69 2.61

3. Erwartete compliance

# We can use the following variables I have already calculated (see Git):
#   - max_participation = Maximum number of probes that a participant can fill ou
#     (note this is based on the da)
#   - valid_probe = Tells us how many probes a participant filled out
#   - day_newest = most recent date a participant filled anything out



expected_compliance = dl %>% 
  group_by(id) %>% 
  summarise(
    valid_probe = sum(valid_probe),
    max_participation = mean(max_participation) ,
    attr = .9, #let's assume attrition of 10% and that this stays constant
    day_newest = max(day_newest),
    max_day_newest = max(dl$day_newest, na.rm = T),
    duration_end = mean(duration_end, na.rm =T)
    ) %>% 
  mutate(
    compliance = valid_probe/max_participation
  ) %>%
summarise(
    pred_compl = 
      ifelse(
        duration_end <= Sys.Date(),
        compliance,
        ifelse(
          max_day_newest == day_newest,
          compliance * attr,  
          # let's assume dropout if no probe on most recent day
          NA)
        )
  )
    
# hist(expected_compliance$pred_compl) # uncomment to get histogram 

table(expected_compliance$pred_compl > .6)

FALSE  TRUE 
  132   188 
table(expected_compliance$pred_compl > .75)

FALSE  TRUE 
  220   100 

Arbeitsauftrag bis nächste Woche

Diese Woche nochmal rekrutieren, rekrutieren, rekrutieren

➡️ Über Weihnachtszeit keine Erhebung