powered by
Computes the summary score ph_y_anthr__height_mean Anthropometrics [Youth] (Height): Mean
ph_y_anthr__height_mean
Summarized variables:
ph_y_anthr__height__r01_001
ph_y_anthr__height__r02_001
ph_y_anthr__height__r03_001
Excluded values: none
There are at most 3 possible measurements, and the calculation is as follows:
0 missing, find the max and min of the three, and take the average of the min and max. Then compare the average to the third value.
third value < average -> mean(min, third value)
third value > average -> mean(max, third value)
third value = average -> third value
1 missing, mean of the rest two
2 missing, use the last one
3 missing, NA
vars_ph_y_anthr__heightcompute_ph_y_anthr__height_mean( data, name = "ph_y_anthr__height_mean", combine = TRUE )
compute_ph_y_anthr__height_mean( data, name = "ph_y_anthr__height_mean", combine = TRUE )
tbl. The input data frame with the summary score appended as a new column.
vars_ph_y_anthr__height is a character vector of all column names used to compute summary scores of ph_y_anthr__height.
ph_y_anthr__height
tbl, Dataframe containing the columns to be summarized.
character, Name of the new column to be created. Default is the name in description, but users can change it.
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.
TRUE
FALSE
if (FALSE) { compute_ph_y_anthr__height_mean(data) |> select( all_of(c("ph_y_anthr__height_mean", vars_ph_y_anthr__height)) ) }
Run the code above in your browser using DataLab