Description Usage Arguments Note References Examples
This function renames columns; converts all columns to numerics (only works on columns where inputs are character strings) and calculates a Positive Life Event score.
1 |
start_col |
The column number where the scale begins, reference by number only. |
end_col |
The column number where the scale end, reference by number only. |
data |
The reference dataframe. |
This function is designed to work with the validated question order as printed in the reference article. This function will give inaccurate results if question order is different from the published validated scale.
Disabato, D. J., Kashdan, T. B., Short, J. L., & Jarden, A. (2017). What predicts positive life events that influence the course of depression? A longitudinal examination of gratitude and meaning in life. Cognitive Therapy and Research, 41(3), 444-458.
1 2 3 4 5 6 7 8 9 10 | df <- data.frame("var1" = c("None", "Did not happen", "Some"),
"var2" = c("Did not happen", "A little","Some"),
"var3" = c("A lot", "Did not happen", "Some"),
"var4" = c("A lot", "A little", "Some"),
"var5" = c("A lot", "Did not happen", "A little"),
"var6" = c("good_event_1", "good_event_2", "good_event_3"),
"var7" = c("None", "A lot", "A little"),
"var8" = c("good_event_4", "good_event_5", "good_event_6"),
"var9" = c("A lot", "A little", "None"))
pos_event(1, 9, df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.