Create a composite factor from a list of variables. A composite factor can be formed using a mean, sum, factor analysis, or principal components.
composite( x, name = NULL, variables, type = "mean", standardize = TRUE, missing_allowed = NULL )
Name of the new composite variable
c() of columns to average together to create the composite
What type of composite should be calculated? options are "mean", "sum", "fa" (factor analysis using psych::fa), or "pca" (principal component analysis using psych::pca). Default is "mean"
Logical. Do you want to calculate the composite based on standardize (z-score) variables? (Default = FALSE)
Criteria for how many variables can having missing values and still calculate a composite