plotLocalTestResults: Plot Results of Local Tests

Description Usage Arguments Examples

View source: R/dagitty.r

Description

Generates a summary plot of the results of local tests (see localTests). For each test, a test statistic and the confidence interval are shown.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotLocalTestResults(
  x,
  xlab = "test statistic (95% CI)",
  xlim = range(x[, c(ncol(x) - 1, ncol(x))]),
  sort.by.statistic = TRUE,
  n = Inf,
  axis.pars = list(las = 1),
  auto.margin = TRUE,
  ...
)

Arguments

x

data frame; results of the local tests as returned by localTests.

xlab

X axis label.

xlim

numerical vector with 2 elements; range of X axis.

sort.by.statistic

logical. Sort the rows of x by the absolute value of the test statistic before plotting.

n

plot only the n tests for which the absolute value of the test statistics diverges most from 0.

axis.pars

arguments to be passed on to axis when generating the Y axis for the plot.

auto.margin

logical. Computes the left margin to fit the Y axis labels.

...

further arguments to be passed on to plot.

Examples

1
2
3
d <- simulateSEM("dag{X->{U1 M2}->Y U1->M1}",.6,.6)
par(mar=c(2,8,1,1)) # so we can see the test names
plotLocalTestResults(localTests( "dag{ X -> {M1 M2} -> Y }", d, "cis" ))

dagitty documentation built on Jan. 21, 2021, 5:07 p.m.