Derives testable implications from the given graphical model and tests them against the given dataset.

1 2 3 4 |

`x` |
the input graph, a DAG, MAG, or PDAG. |

`data` |
matrix or data frame containing the data. |

`type` |
character indicating which kind of local
test to perform. Supported values are |

`tests` |
optional list of the precise tests to perform. If not given, the list of tests is automatically derived from the input graph. Can be used to restrict testing to only a certain subset of tests (for instance, to test only those conditional independencies for which the conditioning set is of a reasonably low dimension, such as shown in the example). |

`sample.cov` |
the sample covariance matrix; ignored if |

`sample.nobs` |
number of observations; ignored if |

`conf.level` |
determines the size of confidence intervals for test statistics. |

`R` |
how many bootstrap replicates for estimating confidence
intervals. If |

`loess.pars` |
list of parameter to be passed on to |

Tetrad implications can only be derived if a Gaussian model (i.e., a linear structural equation model) is postulated. Conditional independence implications (CI) do not require this assumption. However, both Tetrad and CI implications are tested parametrically: for Tetrads, Wishart's confidence interval formula is used, whereas for CIs, a Z test of zero conditional covariance (if the covariance matrix is given) or a test of residual independence after linear regression (it the raw data is given) is performed. Both tetrad and CI tests also support bootstrapping instead of estimating parametric confidence intervals.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# Simulate full mediation model with measurement error of M1
set.seed(123)
d <- simulateSEM("dag{X->{U1 M2}->Y U1->M1}",.6,.6)
# Postulate and test full mediation model without measurement error
plotLocalTestResults(localTests( "dag{ X -> {M1 M2} -> Y }", d, "cis" ))
# Simulate data from example SEM
g <- getExample("Polzer")
d <- simulateSEM(g,.1,.1)
# Compute independencies with at most 3 conditioning variables
imp <- Filter(function(x) length(x$Z)<4, impliedConditionalIndependencies(g))
plotLocalTestResults(localTests( g, d, "cis.loess", R=100, tests=imp, loess.pars=list(span=0.6) ))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.