Time Series Plots, Comparison Graphs, and Multivariate Displays, STAT Principles of Statistics I, Handout 08 – Study Notes

Source: Tamhane/Dunlop Ch. 5, Sec. 6.1, 14.6.2, 15.1

Tags: time series plot, stacked bar plot, contingency table, side-by-side box plot, matrix plot, draftsman plot, scatterplot matrix, fitted line, regression plot, categorical variable, continuous variable, ozone data, epilepsy data, autocorrelation


TL;DR

Beyond Q-Q plots and box plots, several other graphical tools help you explore relationships in data. Time series plots reveal trends and seasonality by plotting values against time. Stacked bar plots display the relationship between two categorical variables. Side-by-side box plots compare a continuous variable across categories. Scatterplot matrices (draftsman plots) show pairwise relationships among many quantitative variables at once, and fitted regression lines summarise those relationships numerically.


Key Terms

Time series plot

A plot of a variable's values on the y-axis against a time index on the x-axis, with points connected by lines. Reveals trends, cycles, and outliers over time.

Autocorrelation

The correlation of a time series with a lagged copy of itself. A high autocorrelation at lag 1 (e.g. 0.33 to 0.43 for the ozone data) means consecutive observations are positively dependent.

Contingency table (cross-tabulation)

A table displaying the joint frequency counts of two categorical variables. Rows represent one variable, columns the other.

Stacked bar plot (stacked bar graph)

A bar chart where each bar is divided into segments representing the proportions of a second categorical variable. Used to visualise the relationship between two categorical variables.

Cluster bar graph

A bar chart where groups of bars are placed side by side for each level of one factor, with each bar coloured or shaded by the level of a second factor. Used for categorical-by-quantitative comparisons.

Side-by-side box plots

Multiple box plots placed on the same axis, one per group or category. Used to compare the distribution of a continuous variable across levels of a categorical variable.

Matrix plot (scatterplot matrix)

A grid of scatterplots showing every pairwise combination of several quantitative variables. The diagonal sometimes shows the variable name or a histogram.

Draftsman plot

Another name for a scatterplot matrix, especially in engineering and quality-control contexts.

Profile plot (interaction plot)

A line graph where the x-axis shows levels of one factor, the y-axis shows a response mean, and separate lines connect the values for each level of a second factor. Non-parallel lines suggest an interaction between the two factors.

Fitted line (regression line)

A curve (often polynomial) fitted to a scatterplot to summarise the relationship between a predictor variable and a response. The adjusted R² indicates how much variability in the response is explained.


Core Content

Time Series Plots

Time series plots are essential when data are collected over time, because patterns like trends, seasonality, and autocorrelation affect how you analyse the data.

The ozone data example compares daily ozone concentrations (ppb) at two locations, Stamford and Yonkers, across five months (May through September):

  • Both locations show high variability, with spikes and clusters of elevated readings

  • Stamford has generally higher concentrations and more extreme values than Yonkers

  • The horizontal reference line at the sample mean helps identify periods above or below average

  • Both time series show positive autocorrelation at lag 1 (Yonkers: 0.43, Stamford: 0.33), meaning high-ozone days tend to follow high-ozone days

Breaking the data into monthly side-by-side box plots reveals seasonal patterns. For the ozone data, July tends to have the highest concentrations and the most variability at both sites.

Stacked Bar Plots: Two Categorical Variables

When both variables are categorical, a contingency table summarises the counts and a stacked bar plot makes the proportions visible.

The TV viewing example cross-tabulates network preference (ABC, CBS, NBC, Other) with residence type (Urban, Suburban, Rural) for 1,500 individuals:

  • Each bar represents one network, segmented into Urban, Suburban, and Rural proportions

  • NBC has the highest proportion of suburban viewers (58.1%)

  • ABC has the most balanced split across residence types

  • This information helps advertisers decide which networks reach which audiences

Converting raw counts to row percentages (so each row sums to 100%) makes the comparison cleaner, because unequal sample sizes per network no longer distort the visual.

Side-by-Side Box Plots: Categorical vs Continuous

When you want to compare a quantitative variable across groups defined by a categorical variable, side-by-side box plots are the standard tool.

The ozone data comparison (Stamford vs Yonkers):

  • Stamford has a higher median and larger IQR

  • Both locations are right-skewed, with outliers above the upper fence

  • Setting the same y-axis scale for both makes comparison fair

The epilepsy study compares base seizure counts and patient ages across treatment (placebo vs progabide):

  • The box plots for base seizure counts show similar medians and spreads in both groups, confirming that randomisation produced comparable groups at baseline

  • The age distributions are also similar between treatment groups

Cluster Bar Graphs and Profile Plots: Factorial Experiments

The baking experiment (3 fat types x 3 surfactant types) measures the mean specific volume of bread loaves:

  • The cluster bar graph shows mean specific volume for each fat-surfactant combination

  • Fat type 3 with surfactant 3 produces the highest volume (8.3)

  • Fat type 1 with surfactant 1 produces the lowest volume (5.567)

Profile plots (interaction plots) display the same data differently:

  • Non-parallel lines suggest that the effect of one factor depends on the level of the other (interaction)

  • In the baking data, the lines are not parallel, particularly for surfactant 3, which shows a steep increase with fat type 3 that is not seen for surfactant 1

Scatterplot Matrices (Matrix / Draftsman Plots)

When you have several quantitative variables measured on the same units, a scatterplot matrix displays all pairwise relationships simultaneously.

The epilepsy data has variables Y1, Y2, Y3, Y4 (seizure counts at four clinic visits), Base (baseline seizure count), and Age:

  • Y1, Y2, Y3, and Y4 are all strongly positively correlated with each other (r = 0.74 to 0.90)

  • All four visit counts are strongly correlated with Base (r = 0.67 to 0.84)

  • Age has essentially no correlation with any seizure count variable (r near 0, p-values > 0.17)

  • One observation (patient 207, with Base = 151 and Y1 = 102) is a clear outlier that heavily influences correlations and regression fits

Fitted Lines and Regression Plots

Regression plots overlay a fitted curve on a scatterplot. The epilepsy data uses cubic polynomial fits:

  • Y1 vs Base: R²_adj = 0.828 with the outlier included, 0.449 without it

  • Y1 vs Age: R²_adj = 0 in both cases (no relationship)

  • Y4 vs Base: R²_adj = 0.812 with the outlier, 0.551 without it

  • Y4 vs Age: R²_adj = 0 in both cases

Key observations:

  • Base seizure count is a strong predictor of seizure counts at each visit

  • Age has no predictive value

  • A single outlier (patient 207) dramatically inflates R² because the regression curve bends to chase that extreme point

  • Removing the outlier shows the relationship is still strong but more moderate

  • The treatment group membership (placebo vs progabide) is indicated by different plot symbols, allowing visual assessment of whether the treatment shifts the response

Ozone Data: Normal and Weibull Reference Plots

The ozone concentrations at both locations are clearly non-normal on normal probability plots (points curve away from the reference line, consistent with right-skewed data).

The Weibull reference plots (plotting log(-log(1 - u_i)) vs log(Y_(i))) show a much better straight-line fit, suggesting that a Weibull distribution is a more appropriate model for ozone concentrations than the normal.


Formulas / Diagrams

Autocorrelation at lag k:

r_k = [sum_{t=1}^{n-k} (Y_t - Y-bar)(Y_{t+k} - Y-bar)] / [sum_{t=1}^{n} (Y_t - Y-bar)²]

Contingency table row percentage:

Row % = (cell count / row total) * 100

Pearson correlation (from epilepsy data correlation matrix):

r(Y1, Base) = 0.796, r(Y1, Age) = 0.008, r(Y4, Base) = 0.843, r(Y4, Age) = -0.077


Why It Matters / Exam Flags

⚠️ Time series data violate the independence assumption. If autocorrelation is present (e.g. lag-1 autocorrelation of 0.33 to 0.43), standard methods that assume independent observations may give misleading results.

⚠️ Side-by-side box plots with different y-axis scales can be deceptive. Always check whether the axes match when comparing groups visually.

⚠️ A single outlier can dramatically change a regression fit. The epilepsy data R²_adj drops from 0.828 to 0.449 when one patient is removed. Always examine scatterplots before trusting summary statistics.

⚠️ Scatterplot matrices are a first step in exploring multivariate data. They can reveal unexpected relationships, clusters, and outliers that univariate summaries miss.

⚠️ When data are right-skewed and non-normal (as with the ozone data), consider alternative distributional models like the Weibull. A Weibull reference plot is done by plotting log(-log(1 - u_i)) vs log(Y_(i)).

⚠️ Profile plots with non-parallel lines suggest an interaction effect. This is important for factorial experiments: you cannot interpret main effects in isolation when there is an interaction.


Practice Q&A

Q: You plot ozone data as a time series and notice that the lag-1 autocorrelation is 0.43. What does this mean practically, and why does it matter for analysis?

A: It means that today's ozone reading is moderately positively correlated with yesterday's reading. High-ozone days tend to cluster together. This matters because many standard statistical methods assume observations are independent, and violating that assumption can lead to underestimated standard errors and overconfident conclusions.

Q: In the epilepsy study, the scatterplot matrix shows strong correlations between Y1 and Base (r = 0.796) but near-zero correlation between Y1 and Age (r = 0.008). What does this tell you about predicting seizure counts?

A: Baseline seizure count is a strong linear predictor of seizure counts during the study, while patient age provides essentially no predictive information. A regression model should include Base as a covariate but can likely omit Age.

Q: The ozone data show a much better fit to a Weibull reference plot than to a normal probability plot. How do you construct the Weibull reference plot in practice?

A: Transform the data by taking logs: W_(i) = log(Y_(i)). Compute the standard log-Weibull quantiles: Q_Z(u_i) = log(-log(1 - u_i)). Plot Q_Z(u_i) on the x-axis against W_(i) on the y-axis. If the points lie close to a straight line, the Weibull model is appropriate.

Q: In a stacked bar plot of TV network preference by residence type, NBC shows 58.1% suburban viewers while ABC shows 43.5%. What type of variable is "residence type" and what type is "network preference"?

A: Both are categorical (qualitative) variables. The stacked bar plot is the appropriate graphical tool for displaying the relationship between two categorical variables.

Q: A regression of Y1 on Base gives R²_adj = 0.828 with all data, but R²_adj = 0.449 when one outlier is removed. What does this tell you about the influence of that observation?

A: The outlier (patient 207, with an extremely high base count of 151) is highly influential. It stretches the regression curve, artificially inflating R². The true underlying relationship is still positive and meaningful (0.449 is still a moderate fit) but much less dominant than the inflated statistic suggests. This is a cautionary example of why you should always examine plots and not rely solely on R².


Related Terms / Search Tags

time series plot, temporal data, autocorrelation, lag-1 correlation, seasonal pattern, stacked bar chart, stacked bar graph, contingency table, cross-tabulation, categorical variable comparison, cluster bar graph, side-by-side box plot, grouped box plot, categorical vs continuous, scatterplot matrix, matrix plot, draftsman plot, pairs plot, pairwise scatterplot, profile plot, interaction plot, factorial experiment, fitted line, regression plot, polynomial regression, R-squared adjusted, influential observation, leverage point, outlier influence, ozone data, epilepsy study, progabide, Weibull reference plot, right-skewed data, STAT 301, Principles of Statistics I, Texas A&M