powered by
Add a rowwise mean or sum index of specific variables to the dataset.
add_index(data, name, ..., type = "mean", na.rm = TRUE)
a tibble
Name of the index column to compute.
Variables used for the index.
Type of index to compute. Either "mean" (default) or "sum".
a logical value indicating whether NA values should be stripped before the computation proceeds. Defaults to TRUE.
NA
TRUE
get_reliability() to compute reliability estimates of added index variables.
get_reliability()
# NOT RUN { WoJ %>% add_index(ethical_flexibility, ethics_1, ethics_2, ethics_3, ethics_4) WoJ %>% add_index(ethical_flexibility, ethics_1, ethics_2, ethics_3, ethics_4, type = "sum") # }
Run the code above in your browser using DataLab