PomaUnivariate: Univariate Statistical Test

View source: R/PomaUnivariate.R

PomaUnivariateR Documentation

Univariate Statistical Test

Description

PomaUnivariate performs parametric and non-parametric univariate statistical tests on a SummarizedExperiment object to compare groups or conditions. Available methods include T-test, ANOVA, ANCOVA, Mann Whitney U Test (Wilcoxon Rank Sum Test), and Kruskal-Wallis.

Usage

PomaUnivariate(
  data,
  method = "ttest",
  covs = NULL,
  error = NULL,
  paired = FALSE,
  var_equal = FALSE,
  adjust = "fdr",
  run_post_hoc = TRUE
)

Arguments

data

A SummarizedExperiment object.

method

Character. The univariate statistical test to be performed. Available options include "ttest" (T-test), "anova" (analysis of variance), "mann" (Wilcoxon rank-sum test), and "kruskal" (Kruskal-Wallis test).

covs

Character vector. Indicates the names of colData columns to be included as covariates. Default is NULL (no covariates). If not NULL, an ANCOVA model will be fitted using the specified covariates. Note: The order of the covariates is important and should be listed in increasing order of importance in the experimental design.

error

Character vector. Indicates the name of a colData column to be included as an error term (e.g. replicates). Default is NULL (no error term).

paired

Logical. Indicates if the data is paired or not. Default is FALSE.

var_equal

Logical. Indicates if the data variances are assumed to be equal or not. Default is FALSE.

adjust

Character. Multiple comparisons correction method to adjust p-values. Available options are: "fdr" (false discovery rate), "holm", "hochberg", "hommel", "bonferroni", "BH" (Benjamini-Hochberg), and "BY" (Benjamini-Yekutieli).

run_post_hoc

Logical. Indicates if computing post-hoc tests or not. Setting this parameter to FALSE can save time for large datasets.

Value

A list with the results.

Author(s)

Pol Castellano-Escuder

Examples

data("st000336")

# Perform T-test
st000336 %>% 
PomaImpute() %>% 
PomaUnivariate(method = "ttest")

# Perform Mann-Whitney U test
st000336 %>% 
PomaImpute() %>% 
PomaUnivariate(method = "mann", adjust = "fdr")

data("st000284")
# Perform Two-Way ANOVA
st000284 %>% 
PomaUnivariate(method = "anova", covs = c("gender"))

# Perform Three-Way ANOVA
st000284 %>% 
PomaUnivariate(method = "anova", covs = c("gender", "smoking_condition"))

# Perform ANCOVA with one numeric covariate and one factor covariate
# st000284 %>% 
# PomaUnivariate(method = "anova", covs = c("age_at_consent", "smoking_condition"))

# Perform Kruskal-Wallis test
st000284 %>% 
PomaUnivariate(method = "kruskal", adjust = "holm")

pcastellanoescuder/POMA documentation built on March 15, 2024, 10:08 p.m.