PomaPCR: Principal Components Regression

View source: R/PomaPCR.R

PomaPCRR Documentation

Principal Components Regression

Description

PomaPCR performs Principal Components Regression.

Usage

PomaPCR(data, center = TRUE, scale = TRUE, ncomp = 2, y = NULL, adjust = "fdr")

Arguments

data

A SummarizedExperiment object.

center

Logical. Indicates whether the variables should be shifted to be zero centered. Default is TRUE.

scale

Logical. Indicates whether the variables should be scaled to have unit variance before the analysis takes place. Default is TRUE.

ncomp

Numeric. Indicates the number of principal components used as predictors in the model. Default is 2.

y

Character. Indicates the name of colData columns to be used as dependent variable. If it's set to NULL, the first numeric variable in colData will be used as the dependent variable.

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).

Value

A tibble with the results.

Author(s)

Pol Castellano-Escuder

Examples

data <- POMA::st000284 %>% # Example SummarizedExperiment object included in POMA
  PomaNorm()

# PCR with 2 components and the default outcome (1st column of `colData`)
data %>%
  PomaPCR(center = TRUE,
          scale = TRUE,
          ncomp = 2,
          y = NULL,
          adjust = "fdr")

# PCR with 2 components and alternative outcome
data %>%
  PomaPCR(center = TRUE,
          scale = TRUE,
          ncomp = 2,
          y = "age_at_consent",
          adjust = "fdr")

# PCR with 20 components and alternative outcome
data %>%
  PomaPCR(center = TRUE,
          scale = TRUE,
          ncomp = 20,
          y = "age_at_consent",
          adjust = "fdr")

pcastellanoescuder/POMA documentation built on Nov. 28, 2024, 1:21 p.m.