Module #10 Assignment
> library(ISwR) > # Fit the linear model to predict spemax based on other variables > model <- lm(pemax ~ age + weight + bmp + fev1, data = cystfibr) > anova_results <- anova(model) > print(anova_results) Analysis of Variance Table Response: pemax Df Sum Sq Mean Sq F value Pr(>F) age 1 10098.5 10098.5 18.4385 0.0003538 *** weight 1 945.2 945.2 1.7258 0.2038195 bmp 1 2379.7 2379.7 4.3450 0.0501483 . fev1 1 2455.6 2455.6 4.4836 0.0469468 * Residuals 20 10953.7 547.7 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > summary_results <- summary(model) > print(summary_results$coefficients) Estimate Std. Error t value Pr(>|t|) (Intercept) 179.295719 61.8854992 2.897217 0.008909191 age -3.418055 3.3085843 -1.033087 0.313894581 weight 2.688189 1.1726985 2.292311 0.032866749 bmp -2.065693 0.8198405 -2.519628 ...