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!

Introduction

Review the psychometric literature on this topic, e.g., Trauer (1999)

How to calculate subscales

Return long format


honos_long <- honos_data %>% 
  pivot_honos_longer(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"), 
                     pivot = "item_scores")

honos_long %>% 
  honos::calc_subscales(id_var = id, 
                        date_var = date, 
                        item_var = item, 
                        value_var = value, 
                        return_format = "long", 
                        return_items = TRUE)
#> Note: This is using the subscales as identified in ... TODO ADD REFERNCE (YEAR).
#> # A tibble: 324 x 11
#>    id    date  team  stage measure  item value prob  spec  honos_subscale
#>    <chr> <chr> <chr> <chr> <chr>   <dbl> <dbl> <chr> <chr> <chr>         
#>  1 id1   2020… team2 pre   honos       1     1 <NA>  <NA>  behaviour     
#>  2 id1   2020… team2 pre   honos       2     2 <NA>  <NA>  behaviour     
#>  3 id1   2020… team2 pre   honos       3     4 <NA>  <NA>  behaviour     
#>  4 id1   2020… team2 pre   honos       4     2 <NA>  <NA>  impairment    
#>  5 id1   2020… team2 pre   honos       5     2 <NA>  <NA>  impairment    
#>  6 id1   2020… team2 pre   honos       6     4 <NA>  <NA>  symptom       
#>  7 id1   2020… team2 pre   honos       7     3 <NA>  <NA>  symptom       
#>  8 id1   2020… team2 pre   honos       8     4 A     <NA>  symptom       
#>  9 id1   2020… team2 pre   honos       9     2 <NA>  <NA>  social        
#> 10 id1   2020… team2 pre   honos      10     3 <NA>  <NA>  social        
#> # … with 314 more rows, and 1 more variable: honos_subscale_value <dbl>

Return wide format


honos_long %>% 
  honos::calc_subscales(id_var = id, 
                        date_var = date, 
                        item_var = item, 
                        value_var = value, 
                        return_format = "wide", 
                        return_items = FALSE)
#> Note: This is using the subscales as identified in ... TODO ADD REFERNCE (YEAR).
#> Warning: Values are not uniquely identified; output will contain list-cols.
#> * Use `values_fn = list` to suppress this warning.
#> * Use `values_fn = length` to identify where the duplicates arise
#> * Use `values_fn = {summary_fun}` to summarise duplicates
#> # A tibble: 18 x 7
#>    id    date  measure honos_behaviour honos_impairment honos_symptom
#>    <chr> <chr> <chr>   <list>          <list>           <list>       
#>  1 id1   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  2 id1   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  3 id1   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  4 id1   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  5 id2   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  6 id2   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  7 id3   2019… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  8 id4   2021… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#>  9 id4   2021… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 10 id4   2021… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 11 id4   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 12 id4   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 13 id4   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 14 id5   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 15 id5   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 16 id5   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 17 id5   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> 18 id5   2020… honos   <dbl [1]>       <dbl [1]>        <dbl [2]>    
#> # … with 1 more variable: honos_social <list>

References

Trauer, Thomas. 1999. “The Subscale Structure of the Health of the Nation Outcome Scales (HoNOS).” Journal of Mental Health 8 (5): 499–509. https://doi.org/10.1080/09638239917193.