2025-10-19

Data generation and model fit

## 
## Call:
## lm(formula = gain ~ hours + protein, data = fitness)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.8912 -1.2813  0.0901  1.4027  4.3000 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 2.789762   0.918042   3.039  0.00293 ** 
## hours       0.632960   0.067735   9.345 7.62e-16 ***
## protein     0.031632   0.007087   4.463 1.87e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.919 on 117 degrees of freedom
## Multiple R-squared:  0.499,  Adjusted R-squared:  0.4904 
## F-statistic: 58.26 on 2 and 117 DF,  p-value: < 2.2e-16

Hours vs Strength Gain (ggplot)

Protein vs Strength Gain (ggplot)

3D Visualization (plotly)

Residuals vs Fitted (ggplot)

Residual diagnostics (qq + hist)