Description Usage Arguments Value Author(s) See Also Examples
cor0.test
computes a p-value for the two-sided test with the null
hypothesis H0: rho == 0 versus the alternative hypothesis HA: rho != 0.
If method="student"
is selected then the statistic
t=r*sqrt((kappa-1)/(1-r*r))
is considered which under H0 is
student-t distributed with df=kappa-1
. This method is exact.
If method="dcor0"
is selected then the p-value is computed
directly from the null distribution of the (partial) correlation
(see dcor0
).
This method is also exact.
If method="ztransform"
is selected then the p-value is computed
using the z-transform (see z.transform
), i.e. using
a suitable chosen normal distribution.
This method returns approximate p-values.
1 |
r |
observed correlation |
kappa |
degree of freedom of the null-distribution |
method |
method used to compute the p-value |
A p-value.
Juliane Sch\"afer and Korbinian Strimmer (https://strimmerlab.github.io).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # load GeneNet library
library("GeneNet")
# covariance matrix
m.cov <- rbind(
c(3,1,1,0),
c(1,3,0,1),
c(1,0,2,0),
c(0,1,0,2)
)
# compute partial correlations
m.pcor <- cor2pcor(m.cov)
m.pcor
# corresponding p-values
# assuming a sample size of 25, i.e. kappa=22
kappa2n(22, 4)
cor0.test(m.pcor, kappa=22)
cor0.test(m.pcor, kappa=22) < 0.05
# p-values become smaller with larger r
cor0.test(0.7, 12)
cor0.test(0.8, 12)
cor0.test(0.9, 12)
# comparison of various methods
cor0.test(0.2, 45, method="student")
cor0.test(0.2, 45, method="dcor0")
cor0.test(0.2, 45, method="ztransform")
|
Loading required package: corpcor
Loading required package: longitudinal
Loading required package: fdrtool
[,1] [,2] [,3] [,4]
[1,] 1.0000000 0.4000000 0.43852901 -0.17541160
[2,] 0.4000000 1.0000000 -0.17541160 0.43852901
[3,] 0.4385290 -0.1754116 1.00000000 0.07692308
[4,] -0.1754116 0.4385290 0.07692308 1.00000000
[1] 25
[,1] [,2] [,3] [,4]
[1,] 0.00000000 0.05860001 0.03633173 0.42338215
[2,] 0.05860001 0.00000000 0.42338215 0.03633173
[3,] 0.03633173 0.42338215 0.00000000 0.72719831
[4,] 0.42338215 0.03633173 0.72719831 0.00000000
[,1] [,2] [,3] [,4]
[1,] TRUE FALSE TRUE FALSE
[2,] FALSE TRUE FALSE TRUE
[3,] TRUE FALSE TRUE FALSE
[4,] FALSE TRUE FALSE TRUE
[1] 0.007722282
[1] 0.001024829
[1] 2.771608e-05
[1] 0.1826482
[1] 0.1826482
[1] 0.183714
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.