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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.