causalEff: Assessment of dynamic causal effects

Description Usage Arguments Details Value Note References See Also Examples

View source: R/dlsem.r

Description

All the pathwise causal lag shapes and the overall one connecting two or more variables are computed.

Usage

1
2
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 containing the names of starting variables, which must be endogenous variables.

to

The name of the ending variable, which must be an endogenous variable.

lag

A non-negative integer or a vector of non-negative integers indicating the time lags to be considered. If NULL, the whole lag shapes will be considered.

cumul

Logical. If TRUE, cumulative causal effects are returned. Default is FALSE.

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.

Details

A pathwise causal lag shape is the set of causal effects associated to a path at different time lags. An overall causal lag shape is the set of overall causal effects of a variable on another one at different time lags.

Note that, due to the properties of the multiple linear regression model, causal effects are net of the influence of the group factor and exogenous variables.

Value

A list containing several matrices including point estimates, standard errors and asymptotic confidence intervals (at level conf) for all the pathwise causal lag shapes and the overall one connecting the starting variables to the ending variable.

Note

Value NULL is returned if one of the following occurs: (i) no significant path at confidence level conf exists connecting the starting variables to the ending variable; (ii) the requested path does not exist or is not significant at confidence level conf. Note that the edges between the starting variables and their respective parents are deleted as a consequence of intervention. See Magrini (2018) for technical details on causal inference in distributed-lag linear structural equation models.

References

A. Magrini (2018). Linear Markovian models for lag exposure assessment. Biometrical Letters, 55(2): 179-195. DOI: 10.2478/bile-2018-0012.

See Also

dlsem; lagPlot.

Examples

1
2
3
4
5
6
7
8
data(industry)
indus.code <- list(
  Consum~ecq(Job,0,5),
  Pollution~ecq(Job,1,8)+ecq(Consum,1,7)
  )
indus.mod <- dlsem(indus.code,group="Region",exogenous=c("Population","GDP"),data=industry,
  log=TRUE)
causalEff(indus.mod,from="Job",to="Pollution",lag=c(0,5,10,15),cumul=TRUE)

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: Rgraphviz
Loading required package: grid
Checking stationarity ...
Order 1 differentiation performed 
Starting estimation ...
Estimating regression 1/3 (Job)
Estimating regression 2/3 (Consum)
Estimating regression 3/3 (Pollution)
Estimation completed                   
$`Job*Consum*Pollution`
    estimate  std. err. lower 95% upper 95%
0  0.0000000 0.00000000 0.0000000 0.0000000
5  0.2000894 0.01207467 0.1764235 0.2237553
10 0.5666692 0.02130344 0.5249152 0.6084232
15 0.5897371 0.02151286 0.5475727 0.6319016

$`Job*Pollution`
    estimate  std. err. lower 95% upper 95%
0  0.0000000 0.00000000 0.0000000 0.0000000
5  0.3526152 0.05733608 0.2402386 0.4649919
10 0.5289228 0.06837109 0.3949180 0.6629277
15 0.5289228 0.06837109 0.3949180 0.6629277

$overall
    estimate  std. err. lower 95% upper 95%
0  0.0000000 0.00000000 0.0000000 0.0000000
5  0.5527046 0.06907040 0.4173291 0.6880801
10 1.0955920 0.08708628 0.9249061 1.2662780
15 1.1186600 0.08713775 0.9478731 1.2894468

dlsem documentation built on April 17, 2020, 1:14 a.m.