Skip to contents

Marginal Effects Plot of Diversity Index Model

Usage

plot_effects_diversity(mod, df, back_transform = FALSE)

Arguments

mod

A fitted model of class 'lm'

df

A dataframe with the columns, lambda, abs_deviation_score_estimate, box_cox_abs_deviation_score_estimate, mean_diversity_index

back_transform

logical, to back-transform box-cox transformed to absolute deviation scores or not

Value

A ggplot with the original data, predicted values and confidence values from the fitted model

Examples

# targets::tar_load(ManyEcoEvo_results) #TODO change this to package data
# library(tidyverse)
# plot_effects_diversity(mod = ManyEcoEvo_results$sorensen_glm[[5]],
# df = ManyEcoEvo_results$effects_analysis[[5]] %>% #dat
# select(mean_diversity_index, study_id,
#          starts_with("box_cox"),
#                   starts_with("abs_dev"),
#                            lambda),
#                            back_transform = TRUE)