CorTable | R Documentation |
This computes correlations from the imputed data, yielding a correlation matrix
as well as matrices for sample size, p-values, and holdout values (computed with
[cor.holdout()]). The latter is a robustness check for the obtained correlation,
denoting how many observations need to be removed before a certain goal is achieved,
such as non-significance, or a flip of the sign of the correlation coefficient
(represented by the argument holdout.goal
).
CorTable(
x,
method = c("pearson", "spearman"),
holdout.goal = c("nsig", "flip"),
alpha = 0.05
)
x |
A matrix or data.frame of which the columns will be correlated with each other |
method |
Whether to use pearson or spearman correlations |
holdout.goal |
When computing the holdout statistic with [cor.holdout()], what should the goal be - non-significance ("nsig") or a flip of the sign ("flip")? |
alpha |
Alpha level for non-significance testing in case |
The output of this object can be printed with [print.CorTable()].
A list with 5 items - 4 matrices (r - correlation, n = sample size, p = p-value, h = holdout value) and a list of parameters, such as the correlation type. NA values among the holdout values indicate that computation failed, e.g. due to insufficient variance or an inability to achieve the holdout goal without depleting the sample size.
Sercan Kahveci
test<-CorTable(mtcars,holdout.goal="flip")
print(test)
test<-CorTable(mtcars,holdout.goal="nsig")
print(test,type="r/h")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.