Learn R Programming

newIMVC (version 0.1.0)

IMVCT: Integrated Mean Variance Correlation Based Hypothesis Test

Description

This function is used to test significance of linear or nonlinear correlation using integrated mean variance correlation

Usage

IMVCT(x, y, K, num_per, NN = 3, type)

Value

The p-value of the corresponding hypothesis test

Arguments

x

is the univariate covariate vector

y

is the response vector

K

is the number of quantile levels

num_per

is the number of permutation times

NN

is the number of B spline basis, default is 3

type

is an indicator for measuring linear or nonlinear correlation, "linear" represents linear correlation and "nonlinear" represents linear or nonlinear correlation using B splines

Examples

Run this code
# linear model
n=100
x=rnorm(n)
y=2*x+rt(n,2)

IMVCT(x,y,K=5,type = "linear")
# nonlinear model
n=100
x=rnorm(n)
y=2*cos(x)+rt(n,2)

IMVCT(x,y,K=5,type = "nonlinear",num_per = 100)

Run the code above in your browser using DataLab