test_association: Test association

View source: R/association_studies.R

test_associationR Documentation

Test association

Description

Function that can be used to test an association between two variables. It uses permutation testing functions from the coin package. It gives a consistent data frame output.

Usage

test_association(
  dataset,
  response.var,
  explanatory.var,
  stratum = NULL,
  n.resample = 10^4,
  ...
)

Arguments

dataset

dataset (data frame format, original: data.wide)

response.var

response variable (for example Granulocytes_count)

explanatory.var

explanatory variable (for example Frailty.index)

stratum

blocking variables (character string)

n.resample

number of resamples

...

other variables that influence the coin::approximate function

Details

Note: Errors can occur when some groups within the blocking variables contain less than two observations. Note2: missing values are (silently) deleted.

Value

data frame with results

Examples

test_association(immune_data, "Tregs", "Frailty.index", "Batch")

LDSamson/associationstudies documentation built on April 14, 2025, 11:52 a.m.