#' Converts SRS raw scores into T scores
#'
#' Takes in data with SRS raw scores in it and converts them into SRS T scores.
#' Currently works on data with the following subscales: Communication, Motivation,
#' Awareness, Cognition and SCI. Ensure that individual subscales are named
#' "SRS_RAW_Score_Pre_(subscale)" and the SCI is named "SRS_RAW_Total_Pre_SCI".
#' Designed for multiply imputed data.
#'
#' @param data dataframe (for Tim's project: a mild object), contains columns
#' with BRIEF raw scores for each of the 9 subscales and GEC
#'
#' @return
#' @export
#'
#' @examples
#' NULL
SRS_convert_T <- function(data){
converted <- data %>%
mutate(SRS_T_Score_Pre_Comm = case_when(
SRS_RAW_Score_Pre_Comm == 0 ~ 37,
SRS_RAW_Score_Pre_Comm == 1 ~ 38,
SRS_RAW_Score_Pre_Comm == 2 ~ 39,
SRS_RAW_Score_Pre_Comm == 3 ~ 40,
SRS_RAW_Score_Pre_Comm == 4 ~ 41,
SRS_RAW_Score_Pre_Comm == 5 ~ 42,
SRS_RAW_Score_Pre_Comm == 6 ~ 43,
SRS_RAW_Score_Pre_Comm == 7 ~ 44,
SRS_RAW_Score_Pre_Comm == 8 ~ 45,
SRS_RAW_Score_Pre_Comm == 9 ~ 46,
SRS_RAW_Score_Pre_Comm == 10 ~ 47,
SRS_RAW_Score_Pre_Comm == 11 ~ 48,
SRS_RAW_Score_Pre_Comm == 12 ~ 49,
SRS_RAW_Score_Pre_Comm == 13 ~ 50,
SRS_RAW_Score_Pre_Comm == 14 ~ 51,
SRS_RAW_Score_Pre_Comm == 15 ~ 52,
SRS_RAW_Score_Pre_Comm == 16 ~ 53,
SRS_RAW_Score_Pre_Comm == 17 ~ 54,
SRS_RAW_Score_Pre_Comm == 18 ~ 55,
SRS_RAW_Score_Pre_Comm == 19 ~ 56,
SRS_RAW_Score_Pre_Comm == 20 ~ 57,
SRS_RAW_Score_Pre_Comm == 21 ~ 58,
SRS_RAW_Score_Pre_Comm == 22 ~ 59,
SRS_RAW_Score_Pre_Comm == 23 ~ 60,
SRS_RAW_Score_Pre_Comm == 24 ~ 61,
SRS_RAW_Score_Pre_Comm == 25 ~ 62,
SRS_RAW_Score_Pre_Comm == 26 ~ 63,
SRS_RAW_Score_Pre_Comm == 27 ~ 64,
SRS_RAW_Score_Pre_Comm == 28 ~ 65,
SRS_RAW_Score_Pre_Comm == 29 ~ 66,
SRS_RAW_Score_Pre_Comm == 30 ~ 67,
SRS_RAW_Score_Pre_Comm == 31 ~ 68,
SRS_RAW_Score_Pre_Comm == 32 ~ 69,
SRS_RAW_Score_Pre_Comm == 33 ~ 70,
SRS_RAW_Score_Pre_Comm == 34 ~ 71,
SRS_RAW_Score_Pre_Comm == 35 ~ 72,
SRS_RAW_Score_Pre_Comm == 36 ~ 73,
SRS_RAW_Score_Pre_Comm == 37 ~ 74,
between(SRS_RAW_Score_Pre_Comm, 38, 39) ~ 75,
SRS_RAW_Score_Pre_Comm == 40 ~ 76,
SRS_RAW_Score_Pre_Comm == 41 ~ 77,
SRS_RAW_Score_Pre_Comm == 42 ~ 78,
SRS_RAW_Score_Pre_Comm == 43 ~ 79,
SRS_RAW_Score_Pre_Comm == 44 ~ 80,
SRS_RAW_Score_Pre_Comm == 45 ~ 81,
SRS_RAW_Score_Pre_Comm == 46 ~ 82,
SRS_RAW_Score_Pre_Comm == 47 ~ 83,
SRS_RAW_Score_Pre_Comm == 48 ~ 84,
SRS_RAW_Score_Pre_Comm == 49 ~ 85,
SRS_RAW_Score_Pre_Comm == 50 ~ 86,
SRS_RAW_Score_Pre_Comm == 51 ~ 87,
SRS_RAW_Score_Pre_Comm == 52 ~ 88,
SRS_RAW_Score_Pre_Comm == 53 ~ 89,
between(SRS_RAW_Score_Pre_Comm, 54, 66) ~ 90)) %>%
mutate(SRS_T_Score_Pre_Motiv = case_when(
SRS_RAW_Score_Pre_Motiv == 0 ~ 37,
SRS_RAW_Score_Pre_Motiv == 1 ~ 39,
SRS_RAW_Score_Pre_Motiv == 2 ~ 41,
SRS_RAW_Score_Pre_Motiv == 3 ~ 42,
SRS_RAW_Score_Pre_Motiv == 4 ~ 44,
SRS_RAW_Score_Pre_Motiv == 5 ~ 46,
SRS_RAW_Score_Pre_Motiv == 6 ~ 48,
SRS_RAW_Score_Pre_Motiv == 7 ~ 49,
SRS_RAW_Score_Pre_Motiv == 8 ~ 51,
SRS_RAW_Score_Pre_Motiv == 9 ~ 52,
SRS_RAW_Score_Pre_Motiv == 10 ~ 54,
SRS_RAW_Score_Pre_Motiv == 11 ~ 56,
SRS_RAW_Score_Pre_Motiv == 12 ~ 57,
SRS_RAW_Score_Pre_Motiv == 13 ~ 59,
SRS_RAW_Score_Pre_Motiv == 14 ~ 61,
SRS_RAW_Score_Pre_Motiv == 15 ~ 62,
SRS_RAW_Score_Pre_Motiv == 16 ~ 64,
SRS_RAW_Score_Pre_Motiv == 17 ~ 66,
SRS_RAW_Score_Pre_Motiv == 18 ~ 67,
SRS_RAW_Score_Pre_Motiv == 19 ~ 69,
SRS_RAW_Score_Pre_Motiv == 20 ~ 71,
SRS_RAW_Score_Pre_Motiv == 21 ~ 72,
SRS_RAW_Score_Pre_Motiv == 22 ~ 74,
SRS_RAW_Score_Pre_Motiv == 23 ~ 76,
SRS_RAW_Score_Pre_Motiv == 24 ~ 77,
SRS_RAW_Score_Pre_Motiv == 25 ~ 79,
SRS_RAW_Score_Pre_Motiv == 26 ~ 81,
SRS_RAW_Score_Pre_Motiv == 27 ~ 82,
SRS_RAW_Score_Pre_Motiv == 28 ~ 84,
SRS_RAW_Score_Pre_Motiv == 29 ~ 86,
SRS_RAW_Score_Pre_Motiv == 30 ~ 87,
SRS_RAW_Score_Pre_Motiv == 31 ~ 89,
between(SRS_RAW_Score_Pre_Motiv, 32, 33) ~ 90)) %>%
mutate(SRS_T_Score_Pre_Cog = case_when(
SRS_RAW_Score_Pre_Cog == 0 ~ 37,
SRS_RAW_Score_Pre_Cog == 1 ~ 39,
SRS_RAW_Score_Pre_Cog == 2 ~ 41,
SRS_RAW_Score_Pre_Cog == 3 ~ 42,
SRS_RAW_Score_Pre_Cog == 4 ~ 44,
SRS_RAW_Score_Pre_Cog == 5 ~ 46,
SRS_RAW_Score_Pre_Cog == 6 ~ 48,
SRS_RAW_Score_Pre_Cog == 7 ~ 49,
SRS_RAW_Score_Pre_Cog == 8 ~ 51,
SRS_RAW_Score_Pre_Cog == 9 ~ 53,
SRS_RAW_Score_Pre_Cog == 10 ~ 55,
SRS_RAW_Score_Pre_Cog == 11 ~ 56,
SRS_RAW_Score_Pre_Cog == 12 ~ 58,
SRS_RAW_Score_Pre_Cog == 13 ~ 60,
SRS_RAW_Score_Pre_Cog == 14 ~ 62,
SRS_RAW_Score_Pre_Cog == 15 ~ 63,
SRS_RAW_Score_Pre_Cog == 16 ~ 65,
SRS_RAW_Score_Pre_Cog == 17 ~ 67,
SRS_RAW_Score_Pre_Cog == 18 ~ 69,
SRS_RAW_Score_Pre_Cog == 19 ~ 70,
SRS_RAW_Score_Pre_Cog == 20 ~ 72,
SRS_RAW_Score_Pre_Cog == 21 ~ 74,
SRS_RAW_Score_Pre_Cog == 22 ~ 76,
SRS_RAW_Score_Pre_Cog == 23 ~ 77,
SRS_RAW_Score_Pre_Cog == 24 ~ 79,
SRS_RAW_Score_Pre_Cog == 25 ~ 81,
SRS_RAW_Score_Pre_Cog == 26 ~ 83,
SRS_RAW_Score_Pre_Cog == 27 ~ 84,
SRS_RAW_Score_Pre_Cog == 28 ~ 86,
SRS_RAW_Score_Pre_Cog == 29 ~ 88,
between(SRS_RAW_Score_Pre_Cog, 30, 36) ~ 90)) %>%
mutate(SRS_T_Score_Pre_Aware = case_when(
SRS_RAW_Score_Pre_Aware == 0 ~ 32,
SRS_RAW_Score_Pre_Aware == 1 ~ 35,
SRS_RAW_Score_Pre_Aware == 2 ~ 38,
SRS_RAW_Score_Pre_Aware == 3 ~ 41,
SRS_RAW_Score_Pre_Aware == 4 ~ 44,
SRS_RAW_Score_Pre_Aware == 5 ~ 47,
SRS_RAW_Score_Pre_Aware == 6 ~ 49,
SRS_RAW_Score_Pre_Aware == 7 ~ 52,
SRS_RAW_Score_Pre_Aware == 8 ~ 55,
SRS_RAW_Score_Pre_Aware == 9 ~ 58,
SRS_RAW_Score_Pre_Aware == 10 ~ 61,
SRS_RAW_Score_Pre_Aware == 11 ~ 64,
SRS_RAW_Score_Pre_Aware == 12 ~ 66,
SRS_RAW_Score_Pre_Aware == 13 ~ 69,
SRS_RAW_Score_Pre_Aware == 14 ~ 72,
SRS_RAW_Score_Pre_Aware == 15 ~ 75,
SRS_RAW_Score_Pre_Aware == 16 ~ 78,
SRS_RAW_Score_Pre_Aware == 17 ~ 81,
SRS_RAW_Score_Pre_Aware == 18 ~ 83,
SRS_RAW_Score_Pre_Aware == 19 ~ 86,
SRS_RAW_Score_Pre_Aware == 20 ~ 89,
between(SRS_RAW_Score_Pre_Aware, 21, 24) ~ 90)) %>%
mutate(SRS_T_Score_Pre_SCI = case_when(
SRS_RAW_Total_Pre_SCI== 0 ~ 35,
between(SRS_RAW_Total_Pre_SCI, 1, 2) ~ 36,
between(SRS_RAW_Total_Pre_SCI, 3, 5) ~ 37,
between(SRS_RAW_Total_Pre_SCI, 6, 7) ~ 38,
between(SRS_RAW_Total_Pre_SCI, 8, 9) ~ 39,
between(SRS_RAW_Total_Pre_SCI, 10, 12) ~ 40,
between(SRS_RAW_Total_Pre_SCI, 13, 14) ~ 41,
between(SRS_RAW_Total_Pre_SCI, 15, 16) ~ 42,
between(SRS_RAW_Total_Pre_SCI, 17, 19) ~ 43,
between(SRS_RAW_Total_Pre_SCI, 20, 21) ~ 44,
between(SRS_RAW_Total_Pre_SCI, 22, 23) ~ 45,
between(SRS_RAW_Total_Pre_SCI, 24, 26) ~ 46,
between(SRS_RAW_Total_Pre_SCI, 27, 28) ~ 47,
between(SRS_RAW_Total_Pre_SCI, 29, 30) ~ 48,
between(SRS_RAW_Total_Pre_SCI, 31, 33) ~ 49,
between(SRS_RAW_Total_Pre_SCI, 34, 35) ~ 50,
between(SRS_RAW_Total_Pre_SCI, 36, 37) ~ 51,
between(SRS_RAW_Total_Pre_SCI, 38, 39) ~ 52,
between(SRS_RAW_Total_Pre_SCI, 40, 42) ~ 53,
between(SRS_RAW_Total_Pre_SCI, 43, 44) ~ 54,
between(SRS_RAW_Total_Pre_SCI, 45, 46) ~ 55,
between(SRS_RAW_Total_Pre_SCI, 47, 49) ~ 56,
between(SRS_RAW_Total_Pre_SCI, 50, 51) ~ 57,
between(SRS_RAW_Total_Pre_SCI, 52, 53) ~ 58,
between(SRS_RAW_Total_Pre_SCI, 54, 56) ~ 59,
between(SRS_RAW_Total_Pre_SCI, 57, 58) ~ 60,
between(SRS_RAW_Total_Pre_SCI, 59, 60) ~ 61,
between(SRS_RAW_Total_Pre_SCI, 61, 63) ~ 62,
between(SRS_RAW_Total_Pre_SCI, 64, 65) ~ 63,
between(SRS_RAW_Total_Pre_SCI, 66, 67) ~ 64,
between(SRS_RAW_Total_Pre_SCI, 68, 70) ~ 65,
between(SRS_RAW_Total_Pre_SCI, 71, 72) ~ 66,
between(SRS_RAW_Total_Pre_SCI, 73, 74) ~ 67,
between(SRS_RAW_Total_Pre_SCI, 75, 77) ~ 68,
between(SRS_RAW_Total_Pre_SCI, 78, 79) ~ 69,
between(SRS_RAW_Total_Pre_SCI, 80, 81) ~ 70,
between(SRS_RAW_Total_Pre_SCI, 82, 84) ~ 71,
between(SRS_RAW_Total_Pre_SCI, 85, 86) ~ 72,
between(SRS_RAW_Total_Pre_SCI, 87, 88) ~ 73,
between(SRS_RAW_Total_Pre_SCI, 89, 91) ~ 74,
between(SRS_RAW_Total_Pre_SCI, 92, 93) ~ 75,
between(SRS_RAW_Total_Pre_SCI, 94, 95) ~ 76,
between(SRS_RAW_Total_Pre_SCI, 96, 97) ~ 77,
between(SRS_RAW_Total_Pre_SCI, 98, 100) ~ 78,
between(SRS_RAW_Total_Pre_SCI, 101, 102) ~ 79,
between(SRS_RAW_Total_Pre_SCI, 103, 104) ~ 80,
between(SRS_RAW_Total_Pre_SCI, 105, 107) ~ 81,
between(SRS_RAW_Total_Pre_SCI, 108, 109) ~ 82,
between(SRS_RAW_Total_Pre_SCI, 110, 111) ~ 83,
between(SRS_RAW_Total_Pre_SCI, 112, 114) ~ 84,
between(SRS_RAW_Total_Pre_SCI, 115, 116) ~ 85,
between(SRS_RAW_Total_Pre_SCI, 117, 118) ~ 86,
between(SRS_RAW_Total_Pre_SCI, 119, 121) ~ 87,
between(SRS_RAW_Total_Pre_SCI, 122, 123) ~ 88,
between(SRS_RAW_Total_Pre_SCI, 124, 125) ~ 89,
between(SRS_RAW_Total_Pre_SCI, 126, 159) ~ 90))
return(converted)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.