pcor_matrix | R Documentation |
This returns a matrix aligned with the cor_matrix()
function after parceling
out the effect of one or more other variables. This function requires complete data;
incomplete cases are dropped with a warning.
pcor_matrix(data, given, ...)
data |
Dataframe. Only numeric variables are included into correlation matrix. |
given |
A character vector with one or multiple variables in data. It/they will be parceled out from all other variables in data, before the correlation table is calculated. |
... |
Arguments passed on to
|
# One might want to estimate correlations between health and possible predictors in the ESS
# after parceling out / controling for key demographic attributes:
pcor_matrix(ess_health, given = c("agea", "gndr"),
var_names = c("health" = "Health", "weight" = "Weight", "dosprt" = "Sport")) %>%
tidy(both_directions = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.