DATA 621 Blog 2 Simple Linear Regression for Time Management:
Linear Regression
Linear regression models the relationship between a response variable and one or more predictors. It estimates how changes in an explanatory variable are associated with changes in the outcome. This method is commonly used to understand trends and make predictions.
In daily life, regression can be applied to time management. For example, it can help examine whether the number of hours spent studying is associated with improved exam scores.
R Example
# Hours studied vs exam score
hours <- c(2, 3, 4, 5, 6, 7, 8, 4, 6, 7)
score <- c(65, 70, 72, 78, 82, 85, 90, 75, 83, 88)
df <- data.frame(hours, score)
df
## hours score
## 1 2 65
## 2 3 70
## 3 4 72
## 4 5 78
## 5 6 82
## 6 7 85
## 7 8 90
## 8 4 75
## 9 6 83
## 10 7 88
Fit the Model
model <- lm(score ~ hours, data = df)
summary(model)
##
## Call:
## lm(formula = score ~ hours, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.7500 -0.5208 -0.0625 0.7396 1.6250
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 56.917 1.092 52.13 2.03e-11 ***
## hours 4.208 0.198 21.25 2.53e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.148 on 8 degrees of freedom
## Multiple R-squared: 0.9826, Adjusted R-squared: 0.9804
## F-statistic: 451.6 on 1 and 8 DF, p-value: 2.528e-08
Visualization
plot(df$hours, df$score,
main = "Study Time vs Exam Score",
xlab = "Hours Studied",
ylab = "Exam Score")
abline(model, lwd = 2)
Interpretation
The slope of the regression line indicates that exam scores tend to increase as study time increases. While this does not guarantee higher performance, it suggests a positive association that can help guide study planning.
Conclusion
Linear regression is a practical tool for understanding how effort relates to outcomes. When applied thoughtfully, it can support better decision-making in everyday academic and professional settings.