Learn R Programming

dlsem (version 1.5)

lagPlot: Plot lag shapes

Description

Plot the lag shape associated to a path or to an overall causal effect.

Usage

lagPlot(model, from = NULL, to = NULL, path = NULL, maxlag = NULL, cumul = FALSE, conf = 0.95, ylim = NULL, title = NULL)

Arguments

model
An object of class dlsem.
from
The name of the covariate.
to
The name of the response variable.
path
The name of the path, indicated as a string made of the names of the variables in the path separated by '*'. Ignored if both from and to are not NULL.
maxlag
The maximum lag displayed (optional).
cumul
Logical. If FALSE (the default), instantaneous coefficients are returned, otherwise cumulative ones are provided.
conf
The confidence level for edges in the object of class dlsem. Default is 0.95.
ylim
A vector of two numerical values indicating the limits of the y axis (optional). If NULL, the limits of the y axis are computed automatically.
title
The title of the plot (optional). If NULL, a default title is used.

See Also

dlsem

Examples

Run this code
data(industry)
mycode <- list(
  Consum~quec(Job,0,6),
  Pollution~quec(Job,1,11)+quec(Consum,1,6)
  )
myfit <- dlsem(mycode,group="Region",exogenous=c("Population","GDP"),
  data=industry,uniroot.check=TRUE,log=TRUE)

# the lag shape associated to specific paths
lagPlot(myfit,path="Job*Pollution")
lagPlot(myfit,path="Job*Consum*Pollution")

# the lag shape associated to an overall causal effect
lagPlot(myfit,from="Job",to="Pollution")

Run the code above in your browser using DataLab