Course contentsShow
← Data Science
Lesson 562 of 2,14515. Regression DiagnosticsFree lesson

Index Plots and Time-Ordered Residuals

Plotting residuals in observation order to detect autocorrelation or systematic data collection issues.

Index Plots and Time-Ordered Residuals

You'll learn how to plot residuals in their original observation order to spot hidden patterns related to data collection or time.

What Are Index Plots?

An index plot (also called a "sequence plot") displays residuals on the y-axis against their observation number or index on the x-axis. Unlike residuals vs fitted values plots (which check for non-linearity and heteroscedasticity), index plots reveal whether residuals show patterns related to the order in which data was collected.

Why Does Order Matter?

Think of it like watching a movie versus seeing random scenes: if you watch frames in order, you might notice a gradual mood shift that you'd miss if scenes were shuffled. Similarly, when data is collected over time or follows a sequence (patients admitted to a hospital, measurements taken day-by-day, records entered by different staff members), residuals might show:

  • Autocorrelation: successive residuals are similar (clustered positive, then negative)
  • Trends: residuals gradually increase or decrease
  • Cyclical patterns: repeating waves suggesting seasonal or periodic effects
  • Sudden shifts: equipment calibration changes, policy updates, or batch effects

What to Look For

In a good index plot, residuals bounce randomly around zero with no discernible pattern—like static noise. Red flags include:

  • Long runs of positive or negative residuals
  • Waves or systematic curves
  • Abrupt jumps at certain observation numbers

These suggest your regression model is missing time-dependent or order-dependent structure that needs addressing (perhaps through time series methods or including additional predictors).

Key Takeaway: Index plots reveal whether your residuals are independent across observations or contain hidden patterns tied to data collection order—a critical check for time-series and sequentially collected data.