PomaLMM: Linear Mixed Models

View source: R/PomaLMM.R

PomaLMMR Documentation

Linear Mixed Models

Description

PomaLMM performs linear mixed models on a SummarizedExperiment object.

Usage

PomaLMM(data, x = NULL, y = NULL, adjust = "fdr", clean_plot = FALSE)

Arguments

data

A SummarizedExperiment object.

x

Character vector. Indicates the names of colData columns to be used as random and fixed effects (independent variables). If it's set to NULL (default), all variables in colData will be used.

y

Character vector. Indicates the names of dependent variables. If it's NULL (default), all features will be used.

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

clean_plot

Logical. Indicates if remove intercept and linear mixed model residues boxplots from the plot. Defasult is FALSE.

Value

A list with results including plots and tables. Table values indicate the percentage variance explained per variable.

Author(s)

Pol Castellano-Escuder

Examples

data("st000284")

# Perform linear mixed model with all features
st000284 %>% 
PomaLMM()

# Perform linear mixed model with two features
st000284 %>% 
PomaLMM(y = c("x1_methyladenosine", "x1_methylhistamine"))

# Perform linear mixed model with one random effect
st000284 %>% 
PomaLMM(x = "smoking_condition")

# Perform linear mixed model with two random effects and two features
st000284 %>% 
PomaLMM(x = c("smoking_condition", "gender"),
        y = c("x1_methyladenosine", "x1_methylhistamine"))
        
# Perform linear mixed model with no random effects and two features, therefore, a linear model will be fitted
st000284 %>% 
PomaLMM(x = "age_at_consent", # Numerical, i.e., fixed effect
        y = c("x1_methyladenosine", "x1_methylhistamine"))
        
# Perform linear mixed model with no random effects and all features, therefore, a linear model will be fitted
st000284 %>% 
PomaLMM(x = "age_at_consent") # Numerical i.e., fixed effect

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