Description Usage Arguments Value Examples
Estimate p-value from the degree statistic
Estimate p-value from the degree statistic
1 2 3 | get_p_from_degree(y, Y, d, numsim = 5000)
get_p_from_degree(y, Y, d, numsim = 5000)
|
y |
vector: main variable of interest |
Y |
Matrix: other variables of interest to measure the correlation with y |
d |
double: computed degree statistic |
numsim |
integer: number of simulations to draw the null distribution |
p value of the degree statistic
p value of the degree statistic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | n = 30
k = 3
nullX = as.matrix(rnorm(30), ncol=1)
nullY = MASS::mvrnorm(n, rep(0,3), diag(3))
d = get_degree(as.matrix(nullX, ncol=1), nullY[,1], nullY[,2:3])
p = get_p_from_degree(nullY[,1], nullY[,2:3], d)
print(paste("The degree statistic is", d, "and the p-value is", p))
n = 30
k = 3
nullX = as.matrix(rnorm(30), ncol=1)
nullY = MASS::mvrnorm(n, rep(0,3), diag(3))
d = get_degree(as.matrix(nullX, ncol=1), nullY[,1], nullY[,2:3])
p = get_p_from_degree(nullY[,1], nullY[,2:3], d)
print(paste("The degree statistic is", d, "and the p-value is", p))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.