Tutorials › Introduction to Statistics › Worked Correlation Analysis of Campus Data

Scatterplots and Correlation · Tutorial 246 of 996

Worked Correlation Analysis of Campus Data

Learn to analyze paired campus data by checking a scatterplot, calculating Pearson’s \(r\), and describing the observed association without claiming it is causal.

Beginner 10 min read

What You'll Learn

  • Organize study hours and exam scores as paired observations.
  • Plot the five hypothetical student pairs and assess the pattern.
  • Calculate Pearson’s \(r\) from deviations from the sample means.
  • Explain what a strong positive correlation says about these observations.
  • Distinguish an association from evidence that studying caused higher scores.
  • Limit conclusions to the students represented by the data.

From Campus Data to a Correlation

Suppose a campus learning center wants to describe how students’ weekly study time relates to their exam scores. A list of study hours by itself cannot answer that question, nor can a list of scores: the information lies in how the two measurements pair up for each student. A scatterplot makes those pairs visible, and Pearson’s correlation \(r\) summarizes the direction and strength of a linear pattern.

The analysis below uses five hypothetical students. The data are deliberately small enough to calculate by hand. With only five observations, the result describes this set of students; it is not a dependable basis for broad claims about all campus students.

StudentStudy hours per week, \(x\)Exam score, \(y\) (points)
A262
B368
C472
D581
E682

Each row is one student, and the two entries in that row form a pair. The study-hours value and exam score must stay together throughout the analysis. If the scores were sorted separately from the hours, the pairings would be lost and the calculated correlation would answer a different question.

Worked Example: Plotting the Student Pairs

Plot the five pairs, with weekly study hours on the horizontal axis and exam score in points on the vertical axis. The table below is a plotting grid: each dot marks one observation at the column’s study-hour value and the row’s exam-score value.

Exam score (points) \ Study hours23456
82●
81●
72●
68●
62●

Reading the grid from left to right, the points rise: the student with 2 study hours has a score of 62, while the student with 6 hours has a score of 82. The five points follow a roughly straight, upward pattern, with no point far separated from the others. This visual check supports using a linear summary for these observations. It does not show that study time caused the score differences.

What Pearson’s Correlation Summarizes

Definition: For \(n\ge2\) paired quantitative observations \((x_i,y_i)\) in which neither variable is constant, Pearson’s sample correlation \(r\) is the standardized measure of their linear association. It ranges from \(-1\) to \(1\). A positive value indicates that larger values of one variable tend to occur with larger values of the other; a negative value indicates that larger values of one tend to occur with smaller values of the other. Values closer to either endpoint describe a stronger linear pattern, while a value near 0 indicates little linear association. Correlation does not measure every possible kind of relationship.

Correlation has no units: changing study hours to minutes or exam scores to a different positive unit does not change \(r\). It is also symmetric: swapping the two variables does not change the correlation. Those properties make it a useful summary, but they do not make it a measure of cause, effect, or change in exam points per additional study hour.

Before reporting Pearson’s \(r\), check that the observations are correctly paired, both variables are quantitative, and the scatterplot is reasonably linear without a dominant outlier. These are conditions for the correlation to be an informative summary of the pattern. Here both variables are quantitative, every student contributes one complete pair, and the plotted points rise in a roughly straight pattern without an isolated point. The small sample still limits how confidently the pattern can represent students beyond these five.

Calculating \(r\) for the Campus Data

The sample means are the centers used to measure how far each observation lies from the average. For the five study-hour values, \(\bar{x}=(2+3+4+5+6)/5=4\) hours. For the exam scores, \(\bar{y}=(62+68+72+81+82)/5=73\) points.

Worked Example: Calculating the Correlation

For paired data, Pearson’s correlation can be calculated from the products of deviations from the two sample means:

$$ r=\frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})} {\sqrt{\left[\sum_{i=1}^{n}(x_i-\bar{x})^2\right] \left[\sum_{i=1}^{n}(y_i-\bar{y})^2\right]}} $$

The entries below show each deviation, their product, and the squared deviations. Study hours are in hours and scores are in points.

Student\(x_i-\bar{x}\) (hours)\(y_i-\bar{y}\) (points)ProductSquared \(x\) deviationSquared \(y\) deviation
A\(-2\)\(-11\)224121
B\(-1\)\(-5\)5125
C0\(-1\)001
D188164
E2918481
Sum5310292

Substituting the three sums gives

$$ r=\frac{53}{\sqrt{10(292)}}= \frac{53}{\sqrt{2920}}\approx 0.9808 $$

The positive sign agrees with the upward pattern in the plot. The value, close to 1, indicates a strong positive linear association in these five paired observations. It is not a percentage, and it does not mean that each extra study hour raises a student’s exam score by 0.9808 points.

Why the Calculation Has This Form

The formula can be justified by expressing correlation as covariance divided by the product of the sample standard deviations. Let \(S_{xy}=\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})\), \(S_{xx}=\sum_{i=1}^{n}(x_i-\bar{x})^2\), and \(S_{yy}=\sum_{i=1}^{n}(y_i-\bar{y})^2\). The sample covariance is \(S_{xy}/(n-1)\), while the sample standard deviations are \(s_x=\sqrt{S_{xx}/(n-1)}\) and \(s_y=\sqrt{S_{yy}/(n-1)}\). Therefore:

$$ \frac{\text{sample covariance}}{s_xs_y} = \frac{S_{xy}/(n-1)} {\sqrt{S_{xx}/(n-1)}\sqrt{S_{yy}/(n-1)}} = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}} $$

The factors of \(n-1\) cancel, yielding the formula used above. The numerator records whether deviations from the two means tend to have the same sign or opposite signs; the denominator scales that sum so the result is a unit-free correlation.

Reporting the Result Without Overclaiming

Worked Example: Writing a Contextual Conclusion

Suppose the learning center asks for a one-sentence summary of this hypothetical analysis. The computed value is \(r\approx0.9808\), and the scatterplot shows a roughly straight upward pattern. A suitable conclusion is:

Among these five hypothetical students, weekly study hours and exam score have a strong positive linear association (\(r\approx0.981\)): students with more recorded study hours tended to have higher recorded exam scores.

This sentence names both variables, gives the direction and strength, and identifies the group actually observed. It does not say that studying more produced the higher scores. Students may differ in prior preparation, course attendance, sleep, or other factors related to both study time and exam performance. Because the data are observational, the correlation by itself cannot separate these explanations from a causal effect.

The sentence also avoids making a general claim about all students at the campus. Five hypothetical observations cannot establish how typical this pattern is in a broader student population. A larger, appropriately selected sample would be needed to support broader descriptions; even a broader sample would not by itself establish causation.

Common Mistakes and Why the Analysis Matters

A correlation analysis is useful because it turns a cloud of paired measurements into a concise, interpretable description. The plot and calculation answer complementary questions: the plot helps reveal shape and unusual points, while \(r\) summarizes the direction and strength of a linear pattern. Reporting both keeps a single number from hiding features that matter.

  • Reading \(r\) as a slope. The value \(0.9808\) is unit-free. It does not say that a score increases by 0.9808 points per additional hour.
  • Calling association a cause. The data show that study hours and exam scores varied together in this set. They do not show that additional study time caused the observed score differences.
  • Ignoring the scatterplot. A correlation summarizes linear association. The plot is needed to check whether that summary reasonably describes the point pattern and whether a point may dominate it.
  • Separating the paired values. Correlation depends on which score belongs with which study-hours value. Reordering one variable independently changes the pairs and may change \(r\).
  • Overgeneralizing from a small set. A high sample correlation does not establish that the same association is present for all campus students. Describe the observed group unless the sampling design supports a wider conclusion.
Key takeaway: Plot the correctly paired quantitative observations, check that a linear summary is sensible, calculate \(r\), and describe its direction and strength in context. Keep the conclusion about association, not causation, and do not extend it beyond the data without a basis for doing so.

Check Your Understanding

Use the campus data and the reasoning in this analysis to answer the following questions.

  1. Why must each student’s study hours remain paired with that student’s exam score when calculating \(r\)?
  2. What does the positive sign of \(r\approx0.9808\) tell you about the observed pattern? What does it not establish?
  3. Give one reason, visible from the analysis, to check a scatterplot before relying on correlation.
  4. Why is it incorrect to interpret \(r=0.9808\) as an increase of 0.9808 exam points per study hour?
  5. Write a conclusion that describes the association while avoiding a causal claim and an unsupported claim about all campus students.