pairwise.cor.test | R Documentation |
Calculate pairwise correlations between group levels with corrections for multiple testing.
pairwise.cor.test(
x,
g,
p.adjust.method = p.adjust.methods,
method = c("pearson", "kendall", "spearman"),
...
)
x |
response vector. |
g |
grouping vector or factor. |
p.adjust.method |
method for adjusting p values (see |
method |
string argument to set the method to compute the correlation. Possibilities are "pearson" (the default), "kendall", and "spearman" |
... |
additional arguments passed to |
Note that correlation tests require that the two vectors examined are of the same length.
Thus, if the grouping defines groups of varying lengths then the specific correlation is
not computed and a NA
is returned instead. The adjusted p values are only based on
the actual correlation that are computed.
Extra arguments that are passed on to cor.test
may or may not be sensible in this context.
Object of class pairwise.htest
attach(airquality)
Month <- factor(Month, labels = month.abb[5:9])
pairwise.cor.test(Ozone, Month)
pairwise.cor.test(Ozone, Month, p.adj = "bonf")
detach()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.