Learn R Programming

dlsem (version 1.0)

lagPlot: Plot lag shapes

Description

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

Usage

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

Arguments

model
An object of class lm or dlsem.
from
The name of the covariate. Ignored if an object of class lm is provided to argument model.
to
The name of the response variable.
path
The name of the path. Ignored if an object of class lm is provided to argument model, or if both from and to are not NULL.
maxlag
The maximum lag displayed (optional).
cumul
Logical. If FALSE (the default), instantaneous path coefficients are returned, otherwise cumulative ones are provided.
conf
The confidence level for edges in the object of class dlsem. Default is 0.95.
nitt
An integer number greater or equal than 1000, representing the number of Monte Carlo replications to approximate confidence intervals. Default is 50000.
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

dlaglm, dlsem

Examples

Run this code
data(agres)
mycode <- list(
  GVA~quec(NPATENT,0,4),
  PPI~quec(NPATENT,0,6)+quec(GVA,0,10),
  ENTR_INCOME~quec(NPATENT,0,3)+quec(GVA,1,10)
  )
mod0 <- dlsem(mycode,group="COUNTRY",context=c("GDP","FARM_SIZE"),
  data=agres,uniroot.check=TRUE,imputation=FALSE,log=TRUE)

# the lag shape associated to specific paths
lagPlot(mod0,path="NPATENT*PPI",nitt=10000)
lagPlot(mod0,path="NPATENT*GVA*PPI",nitt=10000)

# the lag shape associated to an overall causal effect
lagPlot(mod0,from="NPATENT",to="PPI",nitt=10000)

Run the code above in your browser using DataLab