Learn R Programming

dlsem (version 2.0)

causalEff: Assessment of causal effects at different time lags

Description

Given one or more starting variables and one ending variable, return the coefficient associated to each directed path connecting them and the overall one at one or more time lags.

Usage

causalEff(x, from = NULL, to = NULL, lag = NULL, cumul = FALSE, conf = 0.95,
  use.ns = FALSE)

Arguments

x

An object of class dlsem.

from

The name of the starting variable, or a vector of names of starting variables.

to

The name of the ending variable.

lag

A non-negative integer or a vector of non-negative integers indicating the time lags at which coefficients must be computed. If NULL, all relevant time lags are considered.

cumul

Logical. If FALSE (the default), instantaneous coefficients are returned, otherwise cumulative ones are provided.

conf

The confidence level. Default is 0.95.

use.ns

A logical value indicating whether edges without statistically significant causal effect (at level conf) should be considered or not. If FALSE (the default), they will be ignored.

Value

A list containing one matrix for each directed path between the starting variables and the ending variable and one matrix for the overall coefficient. Each matrix contains point estimate and confidence interval (at level conf) for the associated coefficient at each requested time lag.

References

J. Pearl (2012). The Causal Foundations of Structural Equation Modelling. In: R. H. Hoyle (ed.), Handbook of Structural Equation Modelling, Chapter 5. Guilford Press, New York, US-NY. ISBN: 978-16-062-3077-0

See Also

dlsem; lagPlot.

Examples

Run this code
# NOT RUN {
data(industry)
mycode <- list(
  Consum~quec(Job,0,5),
  Pollution~quec(Job,1,8)+quec(Consum,1,6)
  )
myfit <- dlsem(mycode,group="Region",exogenous=c("Population","GDP"),data=industry,log=TRUE)
causalEff(myfit,from="Job",to="Pollution",lag=c(0,5,10,15),cumul=TRUE)
# }

Run the code above in your browser using DataLab