October 2026

The Question

Do students who report more weekly study time tend to earn higher final mathematics grades?

  • Studying is one possible factor associated with achievement.
  • A relationship in observed data does not demonstrate cause and effect.
  • We will examine study-time categories and final mathematics grades.

Dataset and Variables

  • Source: UCI Student Performance dataset, Mathematics records (Cortez, 2008).
  • Sample: 395 students from two Portuguese secondary schools.
  • Study time (studytime): 1 = <2 hours/week; 2 = 2–5; 3 = 5–10; 4 = >10.
  • Final grade (G3): 0–20 points.

Study time is an ordered category, not an exact number of hours. The student records come from school reports and questionnaires.

The Mathematics of Correlation

Pearson’s correlation coefficient measures the strength and direction of a linear association:

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

  • Here, \(x\) is the ordered study-time code (1–4); \(y\) is final grade.
  • \(r\) ranges from \(-1\) (negative) to \(+1\) (positive).
  • Observed Pearson \(r\) = 0.098 (treating the ordered codes as equally spaced for this descriptive calculation).

The Mathematics of Regression

A simple linear model summarizes the average association:

\[\widehat{G3}=b_0+b_1(\mathrm{studytime})\]

For our dataset:

\[\widehat{G3} = 9.33 + 0.53 \times \mathrm{studytime}\]

  • \(b_0\) = model intercept (an extrapolation to code 0, which is not a valid category).
  • \(b_1\) = estimated change in grade points per one-category increase in the study-time code.
  • Because study-time categories cover unequal hour ranges, this is not a per-hour effect.

R Code: Analysis

This is the R code used for the main statistical calculations:

# The dataset has already been loaded in setup.
cor(study_data$studytime, study_data$G3)
model <- lm(G3 ~ studytime, data = study_data)
summary(model)
aggregate(G3 ~ studytime, data = study_data, FUN = mean)

The model is descriptive; it does not adjust for prior grades, attendance, or other influences.

ggplot2 Visualization 1: Student Grades

Interpretation: Compare the center and spread of grades as the reported study-time group increases. Horizontal jitter is only for readability; it does not represent more precise study hours.

ggplot2 Visualization 2: Group Comparison

Interpretation: The boxes show medians and middle-half ranges; overlap between groups demonstrates that study time alone cannot determine a student’s grade.

Interactive Plotly: Explore Individual Records

Hover over the points to inspect reported group and grade; jitter only prevents overplotting.

What Did We Find?

  • Sample size: 395 students.
  • Correlation: \(r = 0.098\).
  • Regression slope: 0.534 grade points per study-time category.
  • \(R^2\): 0.010 (about 1.0% of the sample’s grade variation explained by this one-code linear model).
Study-time group Mean grade (0-20)
<2 hours 10.05
2-5 hours 10.17
5-10 hours 11.40
>10 hours 11.26

Conclusion and Sources

Our question: Is reported weekly study time associated with final mathematics grades?

  • In this sample, the association is positive (Pearson \(r = 0.098\)).
  • Study time alone explains only part of grade variation; group ranges overlap.
  • Limits: observational data, self-reported category ranges, unequal category widths, secondary-school sample, and omitted factors such as prior achievement.
  • Takeaway: Association is not causation; this model should not be used to promise score gains from extra study time.

Data citation: Cortez, P. (2008). Student Performance [Data set]. UCI Machine Learning Repository. https://doi.org/10.24432/C5TG7T

Background: Cortez, P., & Silva, A. (2008). Using data mining to predict secondary school student performance.