score_emotb | R Documentation |
Computes scores for the NIH Toolbox Emotion Measures, Adult Forms (ages 18-52) (2019).
score_emotb(
df,
scales = "all",
max_impute = 0.2,
drop_items = FALSE,
keep_reverse_codes = FALSE,
add_alphas = TRUE,
item_prefix = c("TB_PercStrs_", "TB_Self_", "TB_MP_", "TB_Sad_", "TB_GLS_",
"TB_PosAf_", "TB_AngAf_", "TB_AngPA_", "TB_AngHost_", "TB_EmoSup_", "TB_DLS_",
"TB_FearAf_", "TB_FearSoma_", "TB_Friend_", "TB_InstrSup_", "TB_Lone_",
"TB_PercHost_", "TB_PercRej_", "TB_Apathy_")
)
df |
The data frame containing the assessment items. |
scales |
A character vector specifying the scales to include in the scoring. The default is "all", which includes all scales. Other possible values are: "percstrs", "self", "mp", "sad", "gls", "posaf", "angaf", "angpa", "anghost", "emosup", "fearaf", "fearsoma", "friend", "instrsup", "lone", "perchost", "percrej", and "apathy". |
max_impute |
The threshold for mean imputation. Items with missing values below this threshold will be mean imputed. The default is 0.2. |
drop_items |
Logical indicating whether to drop the individual item columns from the resulting data frame. The default is FALSE. |
keep_reverse_codes |
Logical indicating whether to keep the reverse-coded items in the resulting data frame. The default is FALSE. |
add_alphas |
Logical indicating whether to compute Cronbach's alpha coefficients for the scales and append them to the resulting data frame. The default is TRUE. |
item_prefix |
A character vector specifying the item prefixes as they appear in the data.frame. The vector must be the same length as the 'scales' parameter and prefixes must be in the same corresponding order. If 'scales' is set to "all", the prefixes must appear in the order of possible values for the 'scales' parameter provided above (Perceived Stress, Self Efficacy, etc.). |
The function scores the Adult EMOTB assessment based on the provided data frame. It supports various scoring options, including selecting specific scales, mean imputation of missing values, dropping individual item columns, keeping reverse-coded items, and computing alpha coefficients.
The function adds three columns per scale to the data frame 'df', containing
the raw scores (_Raw
), the theta scores (_Theta
), and the
t-scores (_T
) for the NIH Toolbox Emotion Measures, respectively.
Note: The scoring is based on the 2019 raw score to t-score conversion tables manual. Note: Some measures were omitted from the manual, in which case older versions were used. Note: The function assumes that pasting 'TB_', the subscale, and the item numbers together yields the items from each of the tests.
A data frame with the computed scores and optional alpha coefficients.
Michael Hallquist, Melanie Glatz, Zach Vig
# Score all scales with default options
scores <- score_emotb(data_frame)
# Score specific scales and keep reverse-coded items, while specifying item-level prefixes as they appear in the data
scores <- score_emotb(data_frame, scales = c("self", "angaf"), keep_reverse_codes = TRUE, item_prefix=c("Self_","AngAf_"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.