Learn R Programming

speccurvieR (version 1.0.0)

plot_coef_fit: Plots the independent variable's coefficient against model fit.

Description

plot_coef_fit() plots the independent variable's coefficient against a measure of model fit across specifications, revealing whether better-fitting models tend to produce systematically different estimates (i.e. whether your best-fitting specifications are outliers).

Usage

plot_coef_fit(sca_data, metric = NULL, title = "")

Value

A ggplot object.

Arguments

sca_data

A data frame returned by `sca()`.

metric

A string naming the fit measure to plot against, one of `"RMSE"`, `"adjR"`, `"AIC"`, or `"deviance"`. Defaults to `NULL`, in which case the first measure available in `sca_data` is used.

title

A string to use as the plot title. Defaults to `""`.

Examples

Run this code
plot_coef_fit(sca(y = "Salnty", x = "T_degC",
                controls = c("ChlorA", "O2Sat", "NO2uM"),
                data = bottles, progress_bar = FALSE));

Run the code above in your browser using DataLab