tbl. The input data frame with the summary score appended as
a new column.
Format
vars_mh_y_pps_count is a character vector of all column names
used to compute summary score of mh_y_pps_count and mh_y_pps_nm
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. If FALSE, the summary score will be returned as a
separate data frame.
Details
The mh_y_pps_count is calculated by summing the number of 1s in each
question. If the number of missing values is greater than max_na,
the summary score is set to NA. By default, max_na is set to 4 (20%).