- Dataset & question
- Descriptives
- Exploratory plots (ggplot2)
- Simple Linear Regression (math)
- Model results (plotly)
- Hypothesis test (math)
- Code
- Conclusion
1
Dataset: ScreenTime vs MentalWellness.csv
Survey of 400 participants linking daily screen time and mental wellness index (0–100). Highlights the impact of digital habits on well-being, including sleep, stress, and productivity.
- ScreenTime: daily hours on screens (numeric)
- MentalWellness: well-being score (numeric; higher = better)
Research Question
Is there an optimal range of screen time that supports better well-being?
Thesis
The optimal range of screen time depends on usage context (e.g., educational vs. entertainment), with balanced use supporting the best well-being outcomes.
Code used to compute the summary
n <- nrow(df) mean_screen <- mean(df$ScreenTime); sd_screen <- sd(df$ScreenTime) median_screen <- median(df$ScreenTime) mean_well <- mean(df$MentalWellness); sd_well <- sd(df$MentalWellness) median_well <- median(df$MentalWellness)
We model mental wellness with a quadratic in screen time (to allow an optimal range): \[ \text{MentalWellness}_i = \beta_0 + \beta_1\,\text{ScreenTime}_i + \beta_2\,\text{ScreenTime}_i^{\,2} + \varepsilon_i, \qquad \varepsilon_i \sim \mathcal{N}(0,\sigma^2). \]
Variables - \(\text{ScreenTime}_i\): daily screen time (hours) for participant \(i\)
- \(\text{MentalWellness}_i\): wellness index (0–100) for participant \(i\)
Parameters - \(\beta_1\): marginal effect of screen time near 0
- \(\beta_2\): curvature; if \(\beta_2<0\) we have an inverted-U (best wellness at moderate use)
Estimated optimal screen time (vertex) \[ x^\* \;=\; -\frac{\beta_1}{2\beta_2}. \] If \(\beta_2<0\), \(x^\*\) is the peak (optimal hours). If \(\beta_2>0\), the curve is U-shaped.
Hypothesis for curvature \[ H_0:\ \beta_2 = 0 \quad \text{(no curvature)} \qquad\text{vs}\qquad H_a:\ \beta_2 \neq 0. \]
Note: Wellness is highest at moderate leisure screen hours, suggesting a balanced range supports well-being. As leisure hours increase beyond this range, wellness scores decline, pointing to potential risks of excessive recreational screen use.
Note: Wellness remains fairly stable across moderate work screen hours, with only a slight decline at higher levels. This indicates that work use may be less harmful up to a point, but excessive hours can still lower well-being.
To test whether an optimal range exists, we examine the quadratic term:
\[
H_0: \beta_2 = 0 \quad \text{(no curvature; linear only)}
\]
\[
H_a: \beta_2 \neq 0 \quad \text{(curvature present; optimal range possible)}
\]
Test statistic \[ t = \frac{\hat{\beta}_2}{SE(\hat{\beta}_2)} \quad \text{with } n-3 \text{ degrees of freedom.} \]
Decision rule
- If \(p < \alpha\) (e.g., \(\alpha = 0.05\)), reject \(H_0\).
- Evidence of significant curvature supports the thesis that wellness peaks at a balanced level of screen time.
| Context | Optimal.Hours…. | R. |
|---|---|---|
| Leisure | 13.72 | 0.227 |
| Work | 8.88 | 0.086 |