#collect relevant columns: POSIXct, Date & numericrelevant_columns <- coltype_check$details |>pull(col)#select relevant columnsdata <- data |>select(any_of(relevant_columns))#label variablesdata <-data |>add_radio_factors(codebook, var_col =`Variable / Field Name`, type_col =`Field Type`,levels_col =`Choices, Calculations, OR Slider Labels` ) |>add_col_labels(codebook, var_col =`Variable / Field Name`, label_col =`Field Label`) |>relocate(record_id, any_of(codebook$`Variable / Field Name`)) |>select(-c(uuid_2, enddate_2:last_col(), introduction_wellbeing))
Set relevant dates
#if data was collected between 14:00 and 24:00, it is assigned to the same day.#if collected between 00:00 and 13:59, it is assigned to the previous day.data <- data |>diarydate(startdate_2)attr(data$Date, "label") <-"Date"
Calculate WHO5 score
data <- data |>who5_scoring()
Summarize results
table_wellbeingdiary(data)
Wellbeing diary (WHO-5)
N
N = 1161
I have felt cheerful and in good spirits
116
At no time
0 (0%)
Some of the time
2 (1.7%)
Less than half of the time
3 (2.6%)
More than half of the time
27 (23%)
Most of the time
51 (44%)
All of the time
33 (28%)
I have felt calm and relaxed
116
At no time
0 (0%)
Some of the time
4 (3.4%)
Less than half of the time
11 (9.5%)
More than half of the time
23 (20%)
Most of the time
55 (47%)
All of the time
23 (20%)
I have felt active and vigorous
116
At no time
0 (0%)
Some of the time
2 (1.7%)
Less than half of the time
9 (7.8%)
More than half of the time
32 (28%)
Most of the time
59 (51%)
All of the time
14 (12%)
How would you rate the quality of your sleep last night?
116
Very poor
3 (2.6%)
Poor
12 (10%)
Fair
16 (14%)
Good
59 (51%)
Very good
26 (22%)
My daily life has been filled with things that interest me
116
At no time
0 (0%)
Some of the time
3 (2.6%)
Less than half of the time
14 (12%)
More than half of the time
36 (31%)
Most of the time
50 (43%)
All of the time
13 (11%)
WHO-5 percentage score (calculated, 0-100)
116
76 (66, 84)
Items 4 deviates from the WHO-5 questionnaire. Towards the score it is coded as follows. 1: Very poor | 2: Poor | 3: Fair | 4: Good | 5: Very good.