DAintfun {DAMisc}  R Documentation 
Makes surface plots to display interactions between two continuous variables
DAintfun(
obj,
varnames,
theta = 45,
phi = 10,
xlab = NULL,
ylab = NULL,
zlab = NULL,
adjustY = 0,
plot = TRUE,
hcols = NULL,
...
)
obj 
A model object of class 
varnames 
A twoelement character vector where each element is the name of a variable involved in a twoway interaction. 
theta 
Angle defining the azimuthal viewing direction to be passed to

phi 
Angle defining the colatitude viewing direction to be passed to

xlab 
Optional label to put on the xaxis, otherwise if 
ylab 
Optional label to put on the yaxis, otherwise if 
zlab 
Optional label to put on the zaxis, otherwise if 
adjustY 
Scalar indicating a constant that should be added to all of fitted values. Defaults to 0. 
plot 
Logical indicating whether the plot should be returned. If

hcols 
Vector of four colors to color increasingly high density areas 
... 
Other arguments to be passed down to the initial call to

This function makes a surface plot of an interaction between two continuous
covariates. If the model is
y_{i} = b_{0} + b_{1}x_{i1} +
b_{2}x_{i2} + b_{3}x_{i1}\times x_{i2} + \ldots + e_{i},
this function plots b_{1}x_{i1}
+ b_{2}x_{i2} + b_{3}x_{i1}\times x_{i2}
for
values over the range of X_{1}
and X_{2}
. The highest
75%, 50% and 25% of the bivariate density of X_{1}
and
X_{2}
(as calculated by sm.density
from the sm
package) are colored in with colors of increasing grayscale.
x1 
Values of the first element of 
x2 
Values of the second element of 
pred 
The predictions based on the values

graph 
A graph is produced, but no other information is returned. 
Dave Armstrong
data(InteractionEx)
mod < lm(y ~ x1*x2 + z, data=InteractionEx)
DAintfun(mod, c("x1", "x2"))