composite | R Documentation |
This function will create a composite variable
composite( x, variables, type = "mean", standardize = TRUE, name = NULL, missing.allowed = NULL )
x |
dataframe |
variables |
c() of columns to average together to create the composite |
type |
What type of composite should be calculated?, i.e. mean or sum. (Default = "mean"). |
standardize |
Logical. Do you want to calculate the composite based on standardize (z-score) values? (Default = FALSE) |
name |
Name of the new composite variable |
missing.allowed |
Criteria for how many variables can having missing values and still calculate a composite |
composite(x, variable = c(), type = "mean", name = "name")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.