# get_p_from_degree: Estimate p-value from the degree statistic In tk382/covarianceBP: Analysis of Continuously Varying Correlation

## Description

Estimate p-value from the degree statistic

Estimate p-value from the degree statistic

## Usage

 ```1 2 3``` ```get_p_from_degree(y, Y, d, numsim = 5000) get_p_from_degree(y, Y, d, numsim = 5000) ```

## Arguments

 `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

## Value

p value of the degree statistic

p value of the degree statistic

## Examples

 ``` 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)) ```

tk382/covarianceBP documentation built on July 14, 2020, 4:01 p.m.