Description Usage Arguments Details Value Examples
This function uses appropriate tests of correlation between two variables and stores the estimate and p-value in a list.
1 | omixerCorr(x, y)
|
x |
Randomization variable (e.g. age) |
y |
Technical covariate (e.g. plate number) |
For two categorical variables, the Cramer's V estimate is stored alongside chi-square p-value. For all other combinations of variables, Pearson's correlation coefficient and p-value are stored.
Please note: variables will be converted to numeric class within this function.
List of correlation estimate and p-value
1 2 3 4 5 6 7 8 9 10 11 12 | library(tibble)
library(forcats)
library(stringr)
sampleList <- tibble(sampleId=str_pad(1:48, 4, pad="0"),
sex=as_factor(sample(c("m", "f"), 48, replace=TRUE)),
age=round(rnorm(48, mean=30, sd=8), 0),
smoke=as_factor(sample(c("yes", "ex", "never"), 48, replace=TRUE)),
date=sample(seq(as.Date('2008/01/01'), as.Date('2016/01/01'),
by="day"), 48))
omixerCorr(sampleList$age, sampleList$sex)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.