Description Usage Arguments Value Examples
Computes the score statistic
Computes the score statistic
1 2 3 | get_degree(x, y, Y)
get_degree(x, y, Y)
|
x |
covariate matrix to test |
y |
vector of main variable |
Y |
matrix of the rest of the variables. The row number of Y should match the length of y. |
double: degree statistic
double: 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.