plot_fit2: Model fit comparisons

View source: R/plot_fit2.R

plot_fit2R Documentation

Model fit comparisons

Description

Model fit comparisons

Usage

plot_fit2(
  model_result,
  model_result_y = NULL,
  x,
  y,
  x_label = NULL,
  y_label = NULL,
  metrics = "AIC",
  label = NULL,
  genes = NULL,
  genes_label = NULL,
  subset_genes = NULL,
  outliers = FALSE
)

Arguments

model_result

List of data frames output by kimma::kmFit(). Must contain both x and y models if model_result_y not provided.

model_result_y

List of data frame output by kimma::kmFit()

x

Character string of model to use as reference in fit difference = level - reference. Must match object names in model_result. For example, "lm", "lme", "lmerel"

y

Character string of model to use as level in fit difference = level - reference. Must match object names in model_result. For example, "lm", "lme", "lmerel"

x_label

Character string to use for x model label. If NULL, the model type and variables are used

y_label

Character string to use for y model label. If NULL, the model type and variables are used

metrics

Character vector of metric to plot. For example, "sigma", "AIC", "BIC", "Rsq", "adj_Rsq". Default is "AIC"

label

Numeric. Total number of genes to label. Based on largest absolute change in fit metric.

genes

Data frame with gene metadata for labeling points (optional). If not provided, the gene column in the model_result is used

genes_label

Character string of variable in genes to label with. Required if provide genes parameter

subset_genes

Character vector of genes to subset and plot

outliers

Logical. Include circle for outlier genes as defined by 1.5X interquartile range, similar to geom_boxplot. Default is FALSE

Value

ggplot object

Examples

plot_fit2(example.model, example.model, x="lme", y="lmerel",
          metrics=c("sigma","AIC","Rsq"))

plot_fit2(example.model, example.model, x="lme", y="lmerel",
          metrics=c("sigma","AIC","Rsq"), label=3,
          x_label="without kinship", y_label="with kinship",
          outliers=TRUE)

plot_fit2(example.model, example.model, x="lme", y="lmerel",
          metrics=c("sigma","AIC","Rsq"),
          subset_genes=c("ENSG00000165215","ENSG00000165644","ENSG0000079739"))

BIGslu/BIGpicture documentation built on Oct. 14, 2024, 9:30 p.m.