confounders_clsq {structToolbox}R Documentation

Check for confounding factors in ttest

Description

Compares the coefficients for a ttest without including confounding factors to models with confounding factor included. Currently only ttest is supported.

Usage

confounders_clsq(
  alpha = 0.05,
  mtc = "fdr",
  factor_name,
  confounding_factors,
  threshold = 0.15,
  ...
)

Arguments

alpha

p-value threshold for determining significance. Default alpha = 0.05.

mtc

multiple test correction method to apply. Can be: holm, hochberg, hommel, bonferroni, BH, BY, fdr or [none]

factor_name

the column name of sample_meta to use in regression

confounding_factors

the column names of factors potentially confounding with the main factor if interest

threshold

the threshold (between 0 and 1) for accepting a factor as confounding

...

additional slots and values passed to struct_class

Value

A struct model object with functions for applying classical least squares

struct object

Examples

D = MTBLS79_DatasetExperiment()
M = filter_by_name(mode='include',dimension='variable',
        names=colnames(D$data)[1:10]) + # first 10 features
    filter_smeta(mode='exclude',levels='QC',
        factor_name='class') + # reduce to two group comparison
    confounders_clsq(factor_name = 'class',
        confounding_factors=c('sample_order','batch'))
M = model_apply(M,D)


[Package structToolbox version 1.0.1 Index]