mixedmodel_stability: Analyze reference gene stability in a mixed model framework -...

View source: R/mixedmodel_stability.R

mixedmodel_stabilityR Documentation

Analyze reference gene stability in a mixed model framework – Alternative function

Description

The function is an implementation of the method proposed by Dai, H., et al. (2013) with modifications. The function determines gene stability by iterative fitting of potential gene combinations and calculation of a bootstrap confidence interval around the intraclass correlation. Inference about fixed effects are by default drawn from LRT-tests based where the full model is compared to a reduced model not containing the effects of interest.

Usage

mixedmodel_stability(data, target, response, fixed.effects, random.effect, form,
  reduced.model, icc.model = NULL, hypothesis.test = "LRT",
  LRT.type = "global", p.threshold = 0.05, critical.t = 1.959964,
  icc.interval = 0.95, icc.type = "norm", n.genes = 2, n.sims = 500,
  progress = TRUE)

Arguments

data

a data.frame() in tidy format, each row an observation and each column a variable

target

character name of column containing gene/target identifier

response

character Specifying the respons column, typically expression values.

fixed.effects

character vector specifying fixed effects included in the model

random.effect

character vector specifying the random effect term, should be specified as used in lme4 e.g. (1|participant)

form

formula Specification of formula used in lme4::lmer() for the full model

reduced.model

formula Specification of the model used in calculation of LRT and intraclass correlation

icc.model

formula specification for icc calculation, if NULL then the reduced.model is used

hypothesis.test

Specifies what test to use for the hypothesis test for fixed effects. The default is likelihood-ratio test ("LRT"), other alternatives are tests of regression coefficients using the Walds t-test ("wald.t") with Satterthwaite approximation of degrees of freedom as implemented in the lmerTest package, analysis of variance ("anova") with Satterthwaite approximation of degrees of freedom as implemented in the lmerTest package or t-test for regression parameters ("z.as.t") specifying a critical t-value (default 1.96 z- as t-distribution). Type II Wald chisquare tests implemented the car package ("wald.chi").

LRT.type

Character specifying how LRT test should be performed. "global" tests a model containing all fixed effects against null model (only containing target) and returns a p-value for this test. "add" tests addition of each fixed effects term to a null-model and returns p-values associated with addition of each term. "interaction" tests two models against reduced models interaction between systematic effects and targets are tested together against a model only containing fixed effects and fixed effects are tested against a null-model. P-values for interactions and fixed effects are returned.

p.threshold

numeric Specifying the p-value threshold for hypothesis testing in LRT and Wald t-test of fixed effects.

critical.t

numeric Specifies the t-value threshold for detecting fixed effects in the mixed linear model using t-test of regression coefficients when hypothesis test is "z.as.t", defaults to ~1.96 or qnorm(0.975).

icc.interval

numeric a single fraction specifying the bootstrap confidence interval, defaults to 0.95

icc.type

character specifying which method to use for bootstrap confidence interval calculation ("norm", "basic" or "perc"), default = "norm". See boot::boot.ic for details.

n.genes

numeric A vector specifying the number of genes in possible combinations of genes to be evaluated. Can be a vector of e.g. c(2,3), which will perform the algorithm using combinations of two and three genes/targets.

n.sims

numeric Specifies how many bootstraps to perform for the calculation of CI. This process is time consuming when large numbers are used. Defaults to 500 simulations.

progress

Logical default to TRUE gives a progressbar.

interactions

Logical, if TRUE, interactions between fixed effects and targets are tested in likelihood ratio tests

Value

A data frame with with bootstrap confidence intervals for each possible combination of n.genes without significant fixed effects.

References

Dai, H., et al. (2013). "Mixed modeling and sample size calculations for identifying housekeeping genes." Stat Med 32(18): 3115-3125.


dhammarstrom/generefer documentation built on April 28, 2024, 6:40 a.m.