View source: R/statistics-utils.R
cor_test | R Documentation |
This function is a wrapper around stats::cor.test()
.
It implements the Pearson's correlation test that tests the null hypothesis
that two paired samples of values are unrelated.
This function must be applied to two numeric vectors.
cor_test(x, y, method = "pearson", data)
x |
A numeric variable. |
y |
A numeric variable. |
method |
A character string indicating which correlation coefficient is to be used: "pearson", "kendall", or "spearman". Default method is "pearson". |
data |
A data frame containing the |
A tibble data frame with the correlation statistic, and the corresponding p-value.
cor_test(y = sex_dimorph, x = attractive, data = faithfulfaces)
cor_test(y = sex_dimorph, x = attractive, method = "spearman", data = faithfulfaces)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.