permCor: A permutation test and plotting function

Description Usage Arguments Details Value Examples

View source: R/permCor.R

Description

This function performs a permutation test for the correlation of two samples returning the p-value associated with your original Pearson's correlation, relative to the null permutation distribution.

Usage

1
permCor(x, y, n_samp = 10000, plot = T)

Arguments

x

One continuous variable

y

Another continuous variable

n_samp

The number of permutation iterations. Defaults to 10000

plot

Return a histogram of the permutation distribution with your sample correlation? Defaults to TRUE

Details

Lots of descriptive details could go here. This line just holds the place.

Value

This function returns either a graphical display of a permutation tes of Pearson's correlation between x and y, when plot = T, or the probability of obtaining the correlation between x and y.

Examples

1
2
3
x <- 1:100
y <- jitter(x, factor=100)
permCor(x, y, n_samp = 1000, plot = T)

XinranYPCCC/firstPackage documentation built on Nov. 5, 2019, 2:24 p.m.