MATLAB Examples

Determine Influential Observations Using CovRatio

This example shows how to use the CovRatio statistics to determine the influential points in data. Load the sample data and define the response and predictor variables.

load hospital
y = hospital.BloodPressure(:,1);
X = double(hospital(:,2:5));

Fit a linear regression model.

mdl = fitlm(X,y);

Plot the CovRatio statistics.

plotDiagnostics(mdl,'CovRatio')

For this example, the threshold limits are 1 + 3*5/100 = 1.15 and 1 - 3*5/100 = 0.85. There are a few points beyond the limits, which might be influential points.

Find the observations that are beyond the limits.

find((mdl.Diagnostics.CovRatio)>1.15|(mdl.Diagnostics.CovRatio)<0.85)
ans =

     2
    14
    84
    93
    96