qi_slimmer: Find maximum, minimum, and median values for each scenario...

Description Usage Arguments Details Value Examples

Description

Find maximum, minimum, and median values for each scenario found using qi_builder

Usage

1
qi_slimmer(df, scenario_var = "scenario_", qi_var = "qi_")

Arguments

df

a data frame of simulated quantities of interest created by qi_builder.

scenario_var

character string of the variable name marking the scenarios.

qi_var

character string of the name of the variable with the simulated quantity of interest values.

Details

This funciton slims down a simulation data set to some of its key features (minimun, median, and maximum value for each fitted scenario) so that it takes up less memory and can be easily plotted.

The function is incorporated into qi_builder and can be run using slim = TRUE.

Value

A data frame with the fitted values and the minimum (qi_min), median (qi_median), and maximum (qi_max) values from the central interval specified with ci in qi_builder.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(car)

# Normal linear model
m1 <- lm(prestige ~ education + type, data = Prestige)

# Simulate coefficients
m1_sims <- b_sim(m1)

# Create fitted values
fitted_df <- expand.grid(education = 6:16, typewc = 1)

# Find predicted outcomes (95% central interval, by default)
linear_qi <- qi_builder(b_sims = m1_sims, newdata = fitted_df, slim = FALSE)

# Slim data set
linear_slim <- qi_slimmer(linear_qi)


Search within the coreSim package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.