plot_gamma_regression {baldur}R Documentation

Function for plotting the mean-variance gamma regressions

Description

[Experimental]

Generates a scatter plot with the gamma regressions of the mean-variance trend. Can either be ran directly with plot_gamma_regression and inputing a design matrix, or with plot_gamma if the M-V trend has been added to the data with calculate_mean_sd_trends().

Usage

plot_gamma_regression(data, design)

Arguments

data

The data to use for producing the plots.

design

A design matrix as produced by model.matrix.

Value

a plot with the mean-variance trend before partitioning on the left side, and the right side after.

Examples

# Produce a design matrix
design <- model.matrix(~ 0 + factor(rep(1:2, each = 3)))
colnames(design) <- paste0("ng", c(50, 100))

# Normalize and log transform the data
yeast %>%
    # Remove missing data
    # Note that this could be replaced with imputation
    tidyr::drop_na() %>%
    # Normalize
    psrn("identifier") %>%
    plot_gamma_regression(design)

[Package baldur version 0.0.3 Index]