| plot.confound.grid | R Documentation |
Plot a grid of x y plots showing how a third confounding variable 'z' changes the slope.
## S3 method for class 'confound.grid'
plot(x, f, breaks=4, mains=NA,...)
x |
a data frame |
f |
a formula of the form "Y ~ X | confounder" with names that correspond to names of the dataframe columns. |
breaks |
number or vector of breaks to split the plots horizontally (across x), automatically set for factors. |
mains |
a vector plot title strings; defaults to the continuous->categorical break levels of 'confounder' |
... |
other arguments passed to 'plot' |
A confounding diagnostic grid of plots.
Simpson, E.H. (1951). "The Interpretation of Interaction in Contingency Tables". Journal of the Royal Statiatical Soceity, Series B. 13(2) p. 238-241.
# Swiss Fertility dataset confounding example
plot.confound.grid(x=swiss, f="Infant.Mortality ~ Fertility | Education", breaks=4)
# Intertility dataset confounding example
infert$parity <- as.factor(infert$parity)
plot.confound.grid(x=infert, f="spontaneous ~ age | parity")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.