Description Usage Arguments Author(s) References See Also Examples
Plot method for visualizing how two variables interact to affect the response in regression models.
1 2 3 |
x |
A |
plot.type |
The style of plot to be produced. The following three options are supported:
|
xlab |
Axis label for x variable |
ylab |
Axis label for y variable |
zlab |
Axis label for outcome |
color |
For |
print.cond |
If |
whitespace |
When |
... |
Graphical parameters can be passed to the function to customize the plots. |
Patrick Breheny and Woodrow Burchett
Breheny, P. and Burchett, W. (2017), Visualizing regression models using visreg. https://journal.r-project.org/archive/2017/RJ-2017-046/index.html
http://pbreheny.github.io/visreg/surface.html
visreg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fit <- lm(Ozone ~ Solar.R + Wind + Temp + I(Wind^2) + I(Temp^2) +
I(Wind*Temp)+I(Wind*Temp^2) + I(Temp*Wind^2) + I(Temp^2*Wind^2),
data=airquality)
visreg2d(fit, x="Wind", y="Temp", plot.type="image")
visreg2d(fit, x="Wind", y="Temp", plot.type="image",
color=c("purple", "green", "red"))
visreg2d(fit, x="Wind", y="Temp", plot.type="persp")
## Requires the rgl package
## Not run:
visreg2d(fit,x="Wind",y="Temp",plot.type="rgl")
## End(Not run)
## Requires the ggplot2 package
## Not run:
visreg2d(fit, x="Wind", y="Temp", plot.type="gg")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.