Overview
This project implements a complete statistical inference study on the relationship between healthy habits (sleep, nutrition, physical activity) and academic wellbeing (stress, grades) in university students. The project covers hypothesis formulation, data simulation, probability analysis, sampling distributions, confidence intervals, and hypothesis testing. Research Questions:- Do university students sleep less than the recommended 7 hours per night?
- Is there a relationship between physical activity and stress levels?
- Does healthy eating correlate with better academic performance?
- How do sleep quality and duration affect perceived stress?
Project Structure
Methodology
1. Problem Statement and Study Design
Context: University students face multiple stressors that can affect their health and academic performance. Understanding the relationship between healthy habits and wellbeing can inform intervention programs. Study Design:- Type: Observational, cross-sectional, quantitative
- Population: University students (18-30 years)
- Sample: Simulated random sample of 150 students
- Variables: Sleep hours, sleep quality, physical activity, nutrition score, stress level, GPA
| Variable | Type | Scale | Role |
|---|---|---|---|
edad | Quantitative | Ratio | Descriptive |
horas_sueno | Quantitative | Ratio | Independent |
calidad_sueno | Ordinal | Ordinal (1-5) | Independent |
actividad_fisica | Categorical | Nominal | Independent |
puntaje_alimentacion | Quantitative | Interval (0-10) | Independent |
nivel_estres | Quantitative | Interval (1-10) | Dependent |
promedio_notas | Quantitative | Ratio | Dependent |
2. Data Simulation
Generate realistic student health data using NumPy:3. Probability Analysis
Calculate probabilities of key events:4. Probability Distributions
Normal Distribution for Sleep Hours:5. Sampling Distribution and Central Limit Theorem
Demonstrate CLT with sleep hours:6. Confidence Intervals
7. Hypothesis Testing
Test 1: Do students sleep less than 7 hours on average?
Hypotheses:- H₀: μ ≥ 7 (students sleep at least 7 hours)
- H₁: μ < 7 (students sleep less than 7 hours)
Test 2: Proportion of students with good sleep quality
Hypotheses:- H₀: p ≥ 0.50 (at least half have good sleep quality)
- H₁: p < 0.50 (less than half have good sleep quality)
Test 3: Stress levels by physical activity
Hypotheses:- H₀: μ_high = μ_low (no difference in stress between high and low activity)
- H₁: μ_high < μ_low (high activity students have lower stress)
Key Findings
1. Sleep Duration
- Average: 6.52 hours (significantly below recommended 7 hours)
- Only 37.3% of students meet the 7-hour recommendation
- Statistical significance: p < 0.001
2. Sleep Quality and Stress
- Negative correlation: Better sleep quality associated with lower stress
- Effect size: Each additional point in sleep quality reduces stress by ~0.5 points
3. Physical Activity Impact
- High activity students: Average stress 5.12/10
- Low activity students: Average stress 6.78/10
- Difference: 1.66 points lower stress (p < 0.001)
4. Academic Performance
- Students sleeping ≥ 7h: 60.7% have good grades
- Students sleeping < 7h: 35.4% have good grades
- Healthy eating: Positive correlation with GPA (r = 0.42)
Statistical Concepts Demonstrated
- Hypothesis Formulation: Null and alternative hypotheses
- Data Simulation: Realistic datasets with controlled correlations
- Probability Theory: Joint, conditional, and marginal probabilities
- Distributions: Normal, binomial, and t-distributions
- Central Limit Theorem: Sampling distribution behavior
- Confidence Intervals: Parameter estimation with uncertainty
- Hypothesis Testing: t-tests, z-tests, p-values, Type I/II errors
- Effect Sizes: Practical significance vs statistical significance
Installation and Usage
Conclusions and Recommendations
For Students:
- Prioritize sleep: Aim for 7-8 hours per night
- Stay active: Exercise at least 3 times per week
- Eat well: Maintain balanced nutrition
- Manage stress: Use healthy coping strategies
For Universities:
- Sleep education: Campaigns on sleep hygiene
- Fitness programs: Accessible gym facilities and classes
- Mental health services: Counseling and stress management workshops
- Healthy cafeteria options: Nutritious food availability
Statistical Implications:
- Type I Error Risk: α = 0.05 means 5% chance of false positive
- Type II Error: May miss small but meaningful effects with current sample size
- Generalizability: Results apply to similar university populations
- Causation: Observational design limits causal inference
Future Work
- Longitudinal study: Track students over multiple semesters
- Intervention trial: Randomized controlled trial of sleep/exercise program
- Larger sample: Increase power to detect smaller effects
- Additional variables: Mental health, screen time, caffeine intake
- Mixed methods: Combine quantitative with qualitative interviews