Learn R Programming

dynamac (version 0.1.4)

spike.simulation.graph: Create a spike graph of a simulated response in a dynardl model

Description

Create a spike graph of a simulated response in a dynardl model

Usage

spike.simulation.graph(x, changes = FALSE, bw = FALSE)

Arguments

x

a dynardl model with a simulation to be graphed

changes

whether the graph should be shown in levels of the dependent variable or in changes in levels. The default is FALSE

bw

should the colors be in black and white (for publication)? The default is FALSE

Value

a spike graph

Details

When running dynardl, simulate must be true so that there is a simulation to graph.

Examples

Run this code
# NOT RUN {
# Using the ineq data in dynamac
# Shocking Income Top 10
ardl.model <- dynardl(concern ~ incshare10 + urate, data = ineq, 
       lags = list("concern" = 1, "incshare10" = 1),
       diffs = c("incshare10", "urate"), 
       lagdiffs = list("concern" = 1),
       ec = TRUE, simulate = TRUE, range = 30,
       shockvar = "incshare10", graph = FALSE)
spike.simulation.graph(ardl.model)	# Shows absolute levels
spike.simulation.graph(ardl.model, changes = TRUE)  # Shows changes from mean level
spike.simulation.graph(ardl.model, bw = TRUE)	 # Grayscale plots
# }

Run the code above in your browser using DataLab