Class: LinearModel
Plot interaction effects of two predictors in linear regression model
plotInteraction(mdl,var1,var2)
plotInteraction(mdl,var1,var2,ptype)
h = plotInteraction(...)
plotInteraction(
creates
a plot of the interaction effects of the predictors mdl
,var1
,var2
)var1
and var2
in mdl
.
The plot shows the estimated effect on the response from changing
each predictor value, averaging out the effects of the other predictors.
The plot also shows the estimated effect with the other predictor
fixed at certain values. plotInteraction
chooses
values to produce a relatively large effect on the response. The plot
lets you examine whether the effect of one predictor depends on the
value of the other predictor.
plotInteraction(
returns
a plot of the type specified in mdl
,var1
,var2
,ptype
)ptype
.
returns
handles to the lines in the plot.h
= plotInteraction(...)
For many plots, the Data Cursor tool in the figure window displays the x and y values for any data point, along with the observation name or number.

Linear model, as constructed by 

String naming the variable for plot. 

String naming the variable for plot. 

String naming the plot type.
Default: 

Vector of handles to lines or patches in the plot. 
Use plotEffects
for an effects plot showing separate
effects for all predictors.