Compute "Prodromal Psychosis Scale [Youth] (Severity Score): Mean"
Source:R/scores_mh.R
compute_mh_y_pps__severity_mean.RdComputes the summary score mh_y_pps__severity_mean
Prodromal Psychosis Scale [Youth] (Severity Score): Mean
Summarized variables:
mh_y_pps_001mh_y_pps_002mh_y_pps_003mh_y_pps_004mh_y_pps_005mh_y_pps_006mh_y_pps_007mh_y_pps_008mh_y_pps_009mh_y_pps_010mh_y_pps_011mh_y_pps_012mh_y_pps_013mh_y_pps_014mh_y_pps_015mh_y_pps_016mh_y_pps_017mh_y_pps_018mh_y_pps_019mh_y_pps_020mh_y_pps_021mh_y_pps__severity_001mh_y_pps__severity_002mh_y_pps__severity_003mh_y_pps__severity_004mh_y_pps__severity_005mh_y_pps__severity_006mh_y_pps__severity_007mh_y_pps__severity_008mh_y_pps__severity_009mh_y_pps__severity_010mh_y_pps__severity_011mh_y_pps__severity_012mh_y_pps__severity_013mh_y_pps__severity_014mh_y_pps__severity_015mh_y_pps__severity_016mh_y_pps__severity_017mh_y_pps__severity_018mh_y_pps__severity_019mh_y_pps__severity_020mh_y_pps__severity_021
Excluded values: none
Validation criterion: none of 21 items missing
Usage
compute_mh_y_pps__severity_mean(
data,
name = "mh_y_pps__severity_mean",
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 mean severity score is calculated by dividing the total severity
score by the number of mh_y_pps__bother__yes_count. If any of the
two values is missing, the mean severity score is set to NA.
Examples
if (FALSE) { # \dontrun{
compute_mh_y_pps__severity_mean(data) |>
select(
any_of(c("mh_y_pps__severity_mean", vars_mh_y_pps__severity))
)
} # }