get_first_difference: Get the first difference from a simloglm object

View source: R/get_first_difference.R

get_first_differenceR Documentation

Get the first difference from a simloglm object

Description

Get the first difference from a simloglm object

Usage

get_first_difference(
  input_obj,
  which_qoi = "median",
  which_scenarios = c(1, 2),
  alpha = 0.05
)

Arguments

input_obj

An object of class simloglm (the output of calling simloglm). With at least two scenarios.

which_qoi

Are you interested in the median or mean ? Default is "median".

which_scenarios

If you pass a simloglm object with more than two scenarios please specify which scenarios should be used. Default is c(1, 2).

alpha

The significance level for the resulting confidence interval. Default is 0.05.

Examples

df <- cars
regression <- lm(log(dist)~speed, data = df)
# Explicitily specifying two scenarios.
simulation_results <- simloglm(regression, scenario = list(speed = c(5, 20)))
first_difference_summary <- get_first_difference(simulation_results)
first_difference_summary

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