Compute "Prodromal Psychosis Scale [Youth] (Bother "Yes" responses): Count"
Source:R/scores_mh.R
compute_mh_y_pps__bother__yes_count.RdComputes the summary score mh_y_pps__bother__yes_count
Prodromal Psychosis Scale [Youth] (Bother
Summarized variables:
mh_y_pps__bother_001mh_y_pps__bother_002mh_y_pps__bother_003mh_y_pps__bother_004mh_y_pps__bother_005mh_y_pps__bother_006mh_y_pps__bother_007mh_y_pps__bother_008mh_y_pps__bother_009mh_y_pps__bother_010mh_y_pps__bother_011mh_y_pps__bother_012mh_y_pps__bother_013mh_y_pps__bother_014mh_y_pps__bother_015mh_y_pps__bother_016mh_y_pps__bother_017mh_y_pps__bother_018mh_y_pps__bother_019mh_y_pps__bother_020mh_y_pps__bother_021
Excluded values: none
Validation criterion: 0 of 21 items missing
Usage
compute_mh_y_pps__bother__yes_count(
data,
name = "mh_y_pps__bother__yes_count",
max_na = 0,
combine = TRUE
)Arguments
- data
tbl, Dataframe containing the columns to be summarized.
- name
character, Name of the new column to be created. Default is the name in description, but users can change it.
- max_na
integer, Maximum number of missing values allowed in the summary score.
- combine
logical, If
TRUE, the summary score will be appended to the input data frame. IfFALSE, the summary score will be returned as a separate data frame.
Details
The bother count is depend on the mh_y_pps__bother_nm score. If the
mh_y_pps__bother_nm score is greater than max_na, the bother count
is set to NA.
There is also a sanity check for the gating question in PPS bother score.
If the paired gating question is 0 or NA and the bother score is not
missing, the paired bother score is set to NA before computing the count.
Examples
if (FALSE) { # \dontrun{
compute_mh_y_pps__bother__yes_count(data) |>
select(
any_of(c("mh_y_pps__bother__yes_count", vars_mh_y_pps__bother))
)
} # }