Plot main effects of each predictor in linear regression model
h = plotEffects(mdl)
an effects plot for the predictors in the
model. The plot shows the estimated effect on the response from changing
each predictor value, averaging out the effects of the other predictors.
values to produce a relatively large effect on the response.
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.
Vector of handles to lines or patches in plot.
Plot the effects of two predictors in a fitted linear model.
carsmall data and fit a linear
model of the mileage as a function of model year, weight, and weight
load carsmall ds = dataset(MPG,Weight); ds.Year = ordinal(Model_Year); mdl = fitlm(ds,'MPG ~ Year + Weight^2');
Create an effects plot.
The width of each horizontal line in the figure shows a confidence
interval for the effect on the response of the listed change in each
predictor. The estimated effect of changing
an increase of about 8, and is between 6 and 10 with 95% confidence.
plotInteraction for an effects plot of the
interactions of two specified variables.