lagged_honos_scores.Rmd
lag_honos()
: Calculate lagged scores based on a date variable and calculate change labels (e.g., “high to low”, or ‘deterioration’)calc_change_label()
: Creates change labels for repeated measures of the HoNOS. This is an optional argument in the lag_honos()
function or can be used separatelyIt is slightly confusing to see the two variables honos_i8_prob
and honos_i8_spec
repeated in long format for all 18 items. This is because the information in these two variables cant be used when calculating lagged change scores, but these values are associated with entire assessment of a particular individual. The current implementation allows to filter for all HoNOS assessments with a specified problem in variable honos_i8_prob
using the dplyr::filter()
function for example. This may be useful in cases when it is preferred to only perform analyses for a specified subgroup of individuals, oh highlight different subgroups when plotting the data (e.g., by using the aesthetic colour = prob_var_item8
when using the ggplot2
package for visualising the data).
library(honos)
#> This is honos 0.1.1.9001
#> honos is currently in development - function names and arguments might change.
#> PLEASE REPORT ANY BUGS OR IDEAS!
honos_data %>%
lag_honos(id_var = id,
date_var = date,
value_vars_current = c("q1", "q2", "q3", "q4", "q5", "q6", "q7",
"q8", "q9", "q10", "q11", "q12", "q13"),
prob_var_item8 = c("q8_prob"),
spec_var_item8 = c("q8_spec"),
value_vars_history = c("qa", "qb", "qc", "qd", "qe"))
#> # A tibble: 234 x 14
#> id date team stage honos_i8_prob honos_i8_spec lag1date item
#> <chr> <date> <chr> <chr> <chr> <chr> <date> <dbl>
#> 1 id1 2020-02-11 team1 pre A <NA> 2020-01-01 1
#> 2 id1 2020-02-11 team1 pre A <NA> 2020-01-01 2
#> 3 id1 2020-02-11 team1 pre A <NA> 2020-01-01 3
#> 4 id1 2020-02-11 team1 pre A <NA> 2020-01-01 4
#> 5 id1 2020-02-11 team1 pre A <NA> 2020-01-01 5
#> 6 id1 2020-02-11 team1 pre A <NA> 2020-01-01 6
#> 7 id1 2020-02-11 team1 pre A <NA> 2020-01-01 7
#> 8 id1 2020-02-11 team1 pre A <NA> 2020-01-01 8
#> 9 id1 2020-02-11 team1 pre A <NA> 2020-01-01 9
#> 10 id1 2020-02-11 team1 pre A <NA> 2020-01-01 10
#> # … with 224 more rows, and 6 more variables: type <chr>, honos_value <dbl>,
#> # lag1honos_value <dbl>, honos_change <dbl>, honos_date_diff <drtn>,
#> # honos_change_label <fct>