mbecTestModel: Check If Model Is Estimable

Description Usage Arguments Details Value Examples

View source: R/mbecs_helper.R

Description

Applies Limma's 'nonEstimable()' to a given model and returns NULL if everything works out, or a warning and a vector of problematic covariates in case there is a problem.

Usage

1
mbecTestModel(input.obj, model.vars = NULL, model.form = NULL)

Arguments

input.obj

MbecData, phyloseq or list (counts, meta-data).

model.vars

Names of covariates to construct formula from.

model.form

Formula for a linear model to test.

Details

The usefull part is that you can just put in all the covariates of interest as model.vars and the function will build a simple linear model and its model.matrix for testing. You can also provide more complex linear models and the function will do the rest.

Value

Either NULL if everything is fine or a vector of strings that denote covariates and their respective problematic levels.

Examples

1
2
3
# This will return NULL because it is estimable.
eval.obj <- mbecTestModel(input.obj=dummy.mbec,
model.vars=c("group","batch"))

buschlab/MBECS documentation built on Jan. 21, 2022, 1:27 a.m.