aggregate_simulation_results {simITS}R Documentation

Test a passed test statistic on the simulated data

Description

This method is used to look at summary statistics such as average impact post-policy, and see how the predictive distribution compares to the observed.

Usage

aggregate_simulation_results(
  orig.data,
  predictions,
  outcomename,
  summarizer = calculate_average_outcome,
  ...
)

Arguments

orig.data

The raw data (dataframe)

predictions

The results from process_outcome_model.

outcomename

Outcome to use.

summarizer

A function to calculate some summary quantity, Default: calculate_average_outcome

...

Extra arguments passed to the summarizer function.

Value

List of length two, with first item being the observed value of the test statistic and the second being a numeric vector representing the emperical reference distribution.

Examples

predictions = process_outcome_model( "pbail", mecklenberg,
                                    t0=0, R = 5,
                                    summarize = FALSE, smooth=FALSE )
sstat = aggregate_simulation_results( orig.data = mecklenberg, outcomename = "pbail",
                                     predictions = predictions, months = 1:18 )
sstat$t
sstat$t.obs


[Package simITS version 0.1.1 Index]