# /****************************************************************** # Scale ID: CASP-12 # Scale Name: CASP-12 Quality of Life Scale # TILDA Variables: MHcasp12_control; MHcasp12_autonomy; MHcasp12_pleasure; # MHcasp12_selfreal; MHcasp12_total # Dataset: TILDA Waves 1-7 # Author: # Institution: The Irish Longitudinal Study on Ageing (TILDA) # # Description: # Creates the CASP-19 Quality of Life scale and all associated sub-scales. # # Version: 1.0 # Date: 2026-09-01 # Language: R # # Assumption: # The working data frame is called `data`. # # This translation preserves the Stata scoring logic as written. # ******************************************************************/ # ******************************** # ** CASP-12 Quality of Life ** # ******************************** # # The abbreviated CASP-12 scale replaces CASP-19 # # Item wording and domains for CASP-12 # Questions are SCQCASP# # # CONTROL # 1. My age prevents me from doing the things I would like to # 2. I feel that what happens to me is out of my control # 3. I feel free to plan for the future # 4. I feel left out of things # # AUTONOMY # 7. I feel that I can please myself what I can do # 8. My health stops me from doing the things I want to do # 9. Shortage of money stops me from doing the things that I want to do # # PLEASURE # 10. I look forward to each day # 11. I feel that my life has meaning # 13. I enjoy being in the company of others # # SELF-REALIZATION # 17. I feel satisfied with the way my life has turned out # 18. I feel that life is full of opportunities # # Responses are coded Often 1, Not Often 2, Sometimes 3, and Never 4. # Items 1, 2, 4, 8 and 9 are reverse coded in the source scoring. # # Each subscale is calculated separately and then added together # to provide the total score. # Recode errors (multiple boxes ticked by R) and refusals to missing # Equivalent to: # mvdecode SCQCASP*, mv(-99=. \ -812=. \ -823=. \ -834=.) casp_vars <- grep("^SCQCASP", names(data), value = TRUE) for (var in casp_vars) { data[[var]][data[[var]] %in% c(-99, -812, -823, -834)] <- NA } # CASP-12 Control data$MHcasp12_control <- NA_real_ data$MHcasp12_control[!is.na(data$in_scq) & data$in_scq == 1] <- 0 data$MHcasp12_control <- (data$SCQCASP1 - 1) + (data$SCQCASP2 - 1) + (4 - data$SCQCASP3) + (data$SCQCASP4 - 1) attr(data$MHcasp12_control, "label") <- "CASP-12 Control" # CASP-12 Autonomy data$MHcasp12_autonomy <- NA_real_ data$MHcasp12_autonomy[!is.na(data$in_scq) & data$in_scq == 1] <- 0 data$MHcasp12_autonomy <- (4 - data$SCQCASP7) + (data$SCQCASP8 - 1) + (data$SCQCASP9 - 1) attr(data$MHcasp12_autonomy, "label") <- "CASP-12 Autonomy" # CASP-12 Pleasure data$MHcasp12_pleasure <- NA_real_ data$MHcasp12_pleasure[!is.na(data$in_scq) & data$in_scq == 1] <- 0 data$MHcasp12_pleasure <- (4 - data$SCQCASP13) + (4 - data$SCQCASP10) + (4 - data$SCQCASP11) attr(data$MHcasp12_pleasure, "label") <- "CASP-12 Pleasure" # CASP-12 Self-Realisation data$MHcasp12_selfreal <- NA_real_ data$MHcasp12_selfreal[!is.na(data$in_scq) & data$in_scq == 1] <- 0 data$MHcasp12_selfreal <- (4 - data$SCQCASP17) + (4 - data$SCQCASP18) attr(data$MHcasp12_selfreal, "label") <- "CASP-12 Self-Realisation" # CASP-12 total data$MHcasp12_total <- data$MHcasp12_control + data$MHcasp12_autonomy + data$MHcasp12_pleasure + data$MHcasp12_selfreal attr(data$MHcasp12_total, "label") <- "CASP-12 Quality of Life Scale" attr(data$MHcasp12_total, "note") <- "CASP is a 12-item scale"