cor_test.Rd
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)
A tibble data frame with the correlation statistic, and the corresponding p-value.
cor_test(y = sex_dimorph, x = attractive, data = faithfulfaces)
#> # A tibble: 1 × 4
#> cor t df p_value
#> <dbl> <dbl> <int> <dbl>
#> 1 0.604 9.83 168 2.68e-18
cor_test(y = sex_dimorph, x = attractive, method = "spearman", data = faithfulfaces)
#> Warning: There was 1 warning in `dplyr::summarise()`.
#> ℹ In argument: `get_cor_test_results(attractive, sex_dimorph, "spearman")`.
#> Caused by warning in `cor.test.default()`:
#> ! Cannot compute exact p-value with ties
#> # A tibble: 1 × 3
#> cor t p_value
#> <dbl> <dbl> <dbl>
#> 1 0.582 342385. 8.73e-17