weighted_ses <- function(early_life_ses, educational_luck,
education_covariance) {
ses_weights <- c(1 - education_covariance, education_covariance)
c(early_life_ses, educational_luck) %>%
weighted.mean(ses_weights)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.