Compute "KSADS - Post-Traumatic Stress Disorder [Youth] (Symptom - Past): Mean"
Source:R/scores_mh.R
compute_mh_y_ksads__ptsd__past__sx_mean.RdComputes the summary score mh_y_ksads__ptsd__past__sx_mean
KSADS - Post-Traumatic Stress Disorder [Youth] (Symptom - Past): Mean
[Validation: No more than 4 missing or declined]
Summarized variables:
mh_y_ksads__ptsd__anhed__past_sxmh_y_ksads__ptsd__avoid__extrmnd__past_sxmh_y_ksads__ptsd__avoid__trmatho__past_sxmh_y_ksads__ptsd__concprob__past_sxmh_y_ksads__ptsd__depersnl__past_sxmh_y_ksads__ptsd__derealztn__past_sxmh_y_ksads__ptsd__detach__past_sxmh_y_ksads__ptsd__distortcog__cause__past_sxmh_y_ksads__ptsd__distortcog__consq__past_sxmh_y_ksads__ptsd__emot__neg__past_sxmh_y_ksads__ptsd__emot__nopos__past_sxmh_y_ksads__ptsd__extrmnd__distrs__past_sxmh_y_ksads__ptsd__flshbck__past_sxmh_y_ksads__ptsd__hyprvigl__past_sxmh_y_ksads__ptsd__intrmnd__distrs__past_sxmh_y_ksads__ptsd__irrit__past_sxmh_y_ksads__ptsd__memloss__past_sxmh_y_ksads__ptsd__negblf__past_sxmh_y_ksads__ptsd__nghtmr__past_sxmh_y_ksads__ptsd__physreact__past_sxmh_y_ksads__ptsd__rckls__past_sxmh_y_ksads__ptsd__sleepdistb__past_sxmh_y_ksads__ptsd__startle__past_sxmh_y_ksads__ptsd__trmatho__intru__past_sx
Excluded values:
555
Validation criterion: maximally 4 of 24 items missing
Usage
vars_mh_y_ksads__ptsd__past__sx
compute_mh_y_ksads__ptsd__past__sx_mean(
data,
name = "mh_y_ksads__ptsd__past__sx_mean",
max_na = 4,
exclude = c("555"),
combine = TRUE
)Format
vars_mh_y_ksads__ptsd__past__sx is a character vector
of all column names used to compute summary score of
mh_y_ksads__ptsd__past__sx_mean
Arguments
- data
tbl. Data frame containing the columns to be summarized.
- name
character. Name of the summary score column.
- max_na
numeric, positive whole number. Number of missing items allowed.
NULLmeans no limit.- exclude
character vector. Values to be excluded from the summary score calculation.
- combine
logical. If
TRUE(default), the summary score is is appended as a new column to the input data frame. IfFALSE, the summary score is returned as a separate one-column data frame.
Details
KSADS summary scores are mostly calculating the means over variables, but there are two special codes to handle:
"888": item skipped by branching. When at least one input value is observed, any888value is converted to "0" prior to averaging."555": module not administered. If any input variable is "555" leave the score asNA.NA: missing value. If at least one input value is observed, anyNAvalues are converted to "0" prior to averaging. If all inputs areNA, the summary score remainsNA.