Description Usage Arguments Value Author(s)
This function takes 2 numeric vectors and calculate the
correlation between them. The cor.test
function from the
stats-package
is used to calculate pearson, spearman, or
kendal correlation. A more complex model is supported by setting the method
argument to "lm", and assign a model matrix to the design argument.
1 |
x |
numeric vectors of data values. |
y |
numeric vectors of data values. Must have the same length as x. |
method |
character value indicating which correlation method to be used One of "peason", "kendall", "spearman", or "lm". If "lm" is used, a design argument must be specified. |
... |
other arguments. If either of "person", "kendal", or "spearman"
is specified, any other arguments in the |
A named vector with length of 3 is returned
stat |
the value of the test statistic. |
estimate |
the estimated measure of association. Corresponds to the "r" for pearson, "rho" for spearman, "tau" for kendal, and coefficient for lm |
pval |
the p-value of the test. |
Chenghao Zhu
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.