Description Usage Arguments Value Author(s)
View source: R/plotwtdinteraction.R
plotwtdinteraction
produces a plot from a regression object to
illustrate a two- or three-way interaction for a prototypical individual
holding constant all other variables (or other counterfactuals,
depending on type). Prototypical individual is identified as the mean (numeric), median (ordinal), and/or modal (factors and logical variables) values for all measures. Standard errors are illustrated with polygons by default.
findwtdinteraction
generates a table of point estimates from a regression object to illustrate a two- or three-way interaction for a prototypical individual holding constant all other variables. Prototypical individual is identified as the mean (numeric), median (ordinal), and/or modal (factors and logical variables) values for all measures. Standard errors are illustrated with polygons by default.
plotinteractpreds
plots an object from findwtdinteraction
.
These functions are known to be compatible with lm
,
glm
, as well as multiply imputed lm
and
glm
data generated with the mice
package. They are also compatible with gam
and
bam
regressions from the mgcv package under default.
ordinal regressions (polr) and multinomial regressions (multinom) do not currently support standard errors, additional methods are still being added.
*Note, this set of functions is still in beta, please let me know if you run into any bugs when using it.*
**Important: If you are using a regression output from a multiply imputed dataset with a continuous variable as an interacting term, you should always specify the levels (acrosslevs, bylevs, or atlevs) for the variable, as imputations can change the set of levels that are available and thus can make the point estimates across imputed datasets incompatible with one-another.**
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | plotwtdinteraction(x, across, by=NULL, at=NULL, acrosslevs=NULL, bylevs=NULL,
atlevs=NULL, weight=NULL, dvname=NULL, acclevnames=NULL, bylevnames=NULL,
atlevnames=NULL, stdzacross=FALSE, stdzby=FALSE, stdzat=FALSE, limitlevs=20,
type="response", seplot=TRUE, ylim=NULL, main=NULL, xlab=NULL, ylab=NULL,
legend=TRUE, placement="bottomright", lwd=3, add=FALSE, addby = TRUE, addat=FALSE,
mfrow=NULL, linecol=NULL, secol=NULL, showbynamelegend=FALSE,
showatnamelegend=FALSE, showoutnamelegend = FALSE,
lty=NULL, density=30, startangle=45, approach="prototypical", data=NULL,
nsim=100, ...)
findwtdinteraction(x, across, by=NULL, at=NULL, acrosslevs=NULL, bylevs=NULL,
atlevs=NULL, weight=NULL, dvname=NULL, acclevnames=NULL, bylevnames=NULL,
atlevnames=NULL, stdzacross=FALSE, stdzby=FALSE, stdzat=FALSE, limitlevs=20,
type="response", approach="prototypical", data=NULL, nsim=100)
plotinteractpreds(out, seplot=TRUE, ylim=NULL, main=NULL, xlab=NULL, ylab=NULL,
legend=TRUE, placement="bottomright", lwd=3, add=FALSE, addby = TRUE,
addat=FALSE, mfrow=NULL, linecol=NULL, secol=NULL, showbynamelegend=FALSE,
showatnamelegend=FALSE, showoutnamelegend = FALSE, lty=NULL,
density=30, startangle=45, ...)
|
x |
|
out |
|
across |
|
by |
|
at |
|
acrosslevs |
|
bylevs |
|
atlevs |
|
weight |
|
dvname |
|
acclevnames |
|
bylevnames |
|
atlevnames |
|
stdzacross |
|
stdzby |
|
stdzat |
|
limitlevs |
|
type |
|
seplot |
|
ylim |
|
main |
|
xlab |
|
ylab |
|
legend |
|
placement |
|
lwd |
|
add |
|
addby |
|
addat |
|
mfrow |
|
linecol |
|
secol |
|
showbynamelegend |
|
showatnamelegend |
|
showoutnamelegend |
|
lty |
|
density |
|
startangle |
|
approach |
|
data |
|
nsim |
|
... |
|
A table or figure illustrating the predicted values of the dependent variable across levels of the independent variables for a prototypical respondent.
Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.