Description Usage Arguments Value Note Examples
This function computes the Spearman correlation tests between a fitness
component and all predictors. It is a simple wrapper around the R function
cor.test
, with better display of the output that includes
correction for multiple testing (default = 'bonferroni').
1 2 3 4 5 6 | compute_correlation_table(
cohort = NULL,
fitness = NULL,
method = "bonferroni",
data = NULL
)
|
cohort |
The cohort of males ('C1' or 'C2'). |
fitness |
The column name for the fitness component ('Mat_succ' or 'Rep_succ'). |
method |
The method for the multiple testing correction, see |
data |
The dataset. |
A data.frame containing the predictor, the sample size after discarding the missing values, the correlation between two variables, the p-value of the correlation test, the p-value after correction for multiple testing, the number of tests, the E-value (p-value times number of tests), and significance stars for the raw and adjusted p-values.
We set the argument exact
to FALSE in the call to cor.test
,
so that the presence of ties in some correlation tests would not change
how the p-values are computed (exact tests are not possible in the presence of ties for this implementation of
the test). Otherwise p-values obtained can sometimes be inconsistent across tests (ex: smaller p-values despite higher rho and same sample
size.)
1 | compute_correlation_table(cohort = 'C1', fitness = 'Mat_succ', method = 'bonferroni', data = males)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.