hctest: Test for hidden correlation with one input

Description Usage Arguments Value Author(s) Examples

View source: R/hctest.R

Description

Statistical signficance test for hidden correlation given an input x and residuals.

Usage

1
hctest(x, res)

Arguments

x

the predictor variable

res

residuals, the same length as x

Value

p-value

Author(s)

Yun Shi and A.I. McLeod

Examples

1
2
3
4
5
6
7
8
9
#Example 1
#in this example, there is no hidden correlation
set.seed(313477)
n <- 50
err <- rnorm(n)
x <- rnorm(n)
y <- 1+2*x+err
res <- resid(lm(y~x))
hctest(x, res)

Example output

[1] 0.4979045

hcc documentation built on May 2, 2019, 2:08 a.m.