rcoplot(r,rInt) displays
an error bar plot of the confidence intervals rInt on the residuals
r from a regression. The residuals appear in the plot in case
order.
Plot a residual case order plot by using the rcoplot function. This type of plot can help you identify outliers.
Load the moore data set, which contains the biochemical oxygen demand on five predictors.
load moore
Fit a linearly additive regression model to the data by using the regress function.
X = [ones(size(moore,1),1) moore(:,1:5)];
y = moore(:,6);
alpha = 0.05;
[beta,betaInt,residual,residualInt,stats] = regress(y,X,alpha);
Plot the residuals and prediction intervals from the model.
rcoplot(residual,residualInt)
The interval around the first residual, shown in red, does not contain zero. This result indicates that the residual is larger than expected in 95% of new observations, and suggests that the data point is an outlier.
Residuals, specified as a numeric vector. r must have the same
number of rows as rInt.
Data Types: single | double
Confidence intervals, specified as an n-by-2 numeric matrix,
where n is the number of rows in r.
Data Types: single | double
Axes for the plot, specified as an Axes object. If you do not
specify ax, then rcoplot creates the plot
using the current axes. For more information on creating an Axes
object, see axes.
The rcoplot function now uses a default background and updated
colors. You can add a legend that shows the colored markers for the residuals and intervals,
including any outlier residuals and intervals. To display the legend, use the
legend function.
In previous releases, the plot had a black background, and the legend did not provide
summary information.
Specify the target axes for the plot by using the ax input
argument.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.