Description Usage Arguments Examples
Calculate sum scores of HoNOS subscales (12-item version)
1 2 3 4 5 6 7 8 9 | calc_subscales(
data,
id_var,
date_var,
item_var,
value_var,
return_format = c("long", "wide"),
return_items = FALSE
)
|
data |
Data in long format |
id_var |
Name of variable that uniquely identifies each individual |
date_var |
Name of date (or datetime) variable |
item_var |
Name of variable specifying item numbers |
value_var |
Name of variable with HoNOS scores |
return_format |
String, specifying whether to return data in long (i.e., TODO) or wide (i.e., TODO) format |
return_items |
Logical, specifying whether to include individual item scores. NOTE: CURRENTLY NOT SUPPORTED. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # First create long data set
honos_longish <- 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")
# Then calculate subscales based on individual item scores
honos_longish %>%
calc_subscales(id_var = id,
date_var = date,
item_var = item,
value_var = value,
return_format = "long",
return_items = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.