Learn R Programming

speccurvieR (version 1.0.0)

plot_se: Plots standard error estimates across types.

Description

plot_se() takes the data frame output of `se_compare()` and plots, for each coefficient, the estimate together with a confidence interval derived from every available type of standard error. This makes it easy to see how inference about a coefficient changes with the choice of standard error.

Usage

plot_se(se_data, level = 0.95, intercept = FALSE, title = "")

Value

A ggplot object with one facet per coefficient; within each facet the estimate is plotted against each standard error type with a confidence interval, and the colour indicates whether that interval excludes zero.

Arguments

se_data

A data frame returned by `se_compare()`.

level

The confidence level used for the intervals. Defaults to `0.95`.

intercept

A boolean indicating whether to include the `"(Intercept)"` coefficient. Defaults to `FALSE`.

title

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

Examples

Run this code
plot_se(se_compare(formula = "Salnty ~ T_degC + ChlorA", data = bottles,
                  types = c("iid", "HC0", "HC3")));
plot_se(se_compare(formula = "Salnty ~ T_degC + ChlorA", data = bottles,
                  types = "HC1", cluster = c("Sta_ID", "Depth_ID")),
       level = 0.9);

Run the code above in your browser using DataLab