Learn R Programming

rtpcr (version 2.1.2)

Means_DDCt: Delta Delta Ct pairwise comparisons using a fitted model

Description

Performs relative expression (fold change) analysis based on the Delta Delta Ct (ddCt) methods using a fitted model object produced by ANOVA_DCt(), ANOVA_DDCt() or REPEATED_DDCt().

Usage

Means_DDCt(model, specs, p.adj = "none")

Value

A data frame containing estimated relative expression values, confidence intervals, p-values, and significance levels derived from the fitted model.

Arguments

model

A fitted model object (typically an lmer or lm object) created by ANOVA_DCt(), ANOVA_DDCt() or REPEATED_DDCt().

specs

A character string or character vector specifying the predictors or combinations of predictors over which relative expression values are desired. This argument follows the specification syntax used by emmeans::emmeans() (e.g., "Factor", "Factor1 | Factor2").

p.adj

Character string specifying the method for adjusting p-values. See p.adjust for available options.

Author

Ghader Mirzaghaderi

Details

The Means_DDCt function performs pairwise comparisons of relative expression values fo all combinations using estimated marginal means derived from a fitted model. For ANOVA models, relative expression values can be obtained for main effects, interactions, and sliced (simple) effects. For ANCOVA models returned by the rtpcr package, only simple effects are supported.

Internally, this function relies on the emmeans package to compute marginal means and contrasts, which are then back-transformed to fold change values using the ddCt framework.

Examples

Run this code

data <- read.csv(system.file("extdata", "data_3factor.csv", package = "rtpcr"))

# Obtain a fitted model from ANOVA_DDCt
res <- ANOVA_DDCt(
  data,
  numOfFactors = 3,
  numberOfrefGenes = 1,
  mainFactor.column = 1,
  block = NULL)

# Relative expression values for Type main effect
lm <- res$perGene$PO$lm
Means_DDCt(lm, specs = "Type")

# Relative expression values for Concentration main effect
Means_DDCt(lm, specs = "Conc")

# Relative expression values for Concentration sliced by Type
Means_DDCt(lm, specs = "Conc | Type")

# Relative expression values for Concentration sliced by Type and SA
Means_DDCt(lm, specs = "Conc | Type * SA")

Run the code above in your browser using DataLab