plot.simloglm: Plot function for a simloglm object

View source: R/plot.R

plot.simloglmR Documentation

Plot function for a simloglm object

Description

Plot function for a simloglm object

Usage

## S3 method for class 'simloglm'
plot(input_obj, which_qoi = "median", alpha = 0.05, twosided = TRUE)

Arguments

input_obj

Either a list of class "lm" (the output from a call to lm) or a user provided list with the following entries beta_hat (the estimated regression coefficients), varcov_hat (the estimated variance covariance matrix), sigma_hat (the estimated residual standard error), n (the number of observations) and k (the number of regression coefficients). The list can be provided for more flexibility. Most users will call simulate directly on the output from a call to lm.

which_qoi

Which mean should be plotted? Median or mean, defaults to "median".

alpha

Set the significance level. Default is 0.05.

twosided

Do you want two sided confidence intervals? Defaults to TRUE.

Value

A plot of the simloglm object.

Examples

df <- cars
regression <- lm(log(dist)~speed, data = df)
# Specifiying no scenario to simulate at the mean of speed.
plot(simloglm(regression))
# Explicitily specifying a scenario.
plot(simloglm(regression, scenario = list(speed = c(5, 10, 20))))

mneunhoe/simloglm documentation built on June 14, 2022, 5:18 p.m.