View source: R/localize_plot.R
| plot.gof_localize | R Documentation |
Draws the verdict of localize.external or localize.gof in two
panels. The misfit compass has one wedge per part (intercept, slope, link, cov); the
length of a wedge is the strength of evidence, -\log_{10} p of the part's own test
(capped at p = 0.001), the dashed ring marks alpha, and the parts named are filled.
The lattice of closed tests shows every set of the parts tested with the p-value of its
test, shaded when it rejects; a part is named when every set that contains it rejects, and the
links from a named part up to those sets are drawn dark. The lattice writes the intercept as
"intcpt", so the label fits its node at 7 pt. The highest part named and the next
step are written under the panels. Parts that cannot be tested in the setting (intercept and
slope in-sample) are shown as empty wedges marked "not tested".
## S3 method for class 'gof_localize'
plot(
x,
which = c("both", "compass", "lattice"),
colour = TRUE,
main = NULL,
...
)
x |
A |
which |
|
colour |
|
main |
Title; by default the setting and the sample size. |
... |
Not used. |
x, invisibly.
set.seed(1)
n <- 500
X <- data.frame(x1 = rnorm(n), x2 = rnorm(n))
p <- plogis(-0.5 + 0.8 * X$x1 + 0.6 * X$x2)
y <- rbinom(n, 1, plogis(qlogis(p) + 0.8 * X$x1 * X$x2))
r <- localize.external(y, p, X, M = 199, seed = 1)
plot(r)
plot(r, which = "compass", colour = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.