Learn R Programming

dynamac (version 0.1.8)

dynardl.simulation.plot: Create a plot of a simulated response in a dynardl model

Description

Create a plot of a simulated response in a dynardl model

Usage

dynardl.simulation.plot(x, type = "area", response = "levels",
  bw = FALSE, y.lab = "", x.lab = "")

Arguments

x

a dynardl model with a simulation to be plotted

type

whether the plot should be an area plot (area) or a spike plot (spike)

response

whether the plot of the response should be shown in levels of the dependent variable (levels), changes from the mean of the dependent variable (levels.from.mean), period-over-period changes in the dependent variable (diffs), the sum of the period-over-period changes (cumulative.diffs), or the absolute value of the cumulative differences (cumulative.abs.diffs). The default is levels

bw

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

y.lab

a user-defined y-label to be used instead of the default

x.lab

a user-defined x-label to be used instead of the default

Value

a plot of the simulated dynardl model

Details

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

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")

# Shows absolute levels
dynardl.simulation.plot(ardl.model)	
# Shows changes from mean level
dynardl.simulation.plot(ardl.model, response = "levels.from.mean")  
# Same plot, but with spikeplot
dynardl.simulation.plot(ardl.model, type = "spike", response = "levels.from.mean")  
# Grayscale plots
dynardl.simulation.plot(ardl.model, bw = TRUE)	 
# }

Run the code above in your browser using DataLab