pairtest: Tests if every column is independent of each other

Description Usage Arguments Details Examples

Description

pairtest tests association between columns of a dataframe.

Usage

1

Arguments

df

a dataframe of variables, where the variables are arranged in columns, and samples or observations in rows.

Details

Each variable is tested for their association with each other variable in simple linear regression (if at least one numerical variable), or chi squared test (if two categorical).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## to calculate PC association with covariates

library(plyr)

variables <- data.frame(
  row = c(1, 1, 2, 2, 3, 3),
  column = c(1, 1, 1, 2, 2, 2),
  Sex = c('m', 'm', 'm', 'f', 'f', 'f'),
  age = c(18, 19, 18, 27, 30, 16),
  ethnicity = c('AF', 'AF', 'AF', 'EU', 'EU', 'AS'))
  
pairtest(variables)

wvictor14/plomics documentation built on June 19, 2019, 12:45 a.m.