── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (4): Country, Region, Water Source Type, Water Treatment Method
dbl (20): Year, Contaminant Level (ppm), pH Level, Turbidity (NTU), Dissolve...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Call:
lm(formula = DissolvedOxygen ~ Nitrate + pH + Turbidity + Temperature +
Rainfall + Bacteria + Lead, data = multi_data)
Residuals:
Min 1Q Median 3Q Max
-3.8303 -1.7388 -0.2013 1.8426 3.9137
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.128e+00 9.755e-01 6.282 6.97e-10 ***
Nitrate -1.770e-02 6.212e-03 -2.849 0.00456 **
pH 4.962e-02 1.229e-01 0.404 0.68663
Turbidity -2.686e-02 6.247e-02 -0.430 0.66734
Temperature 5.150e-03 7.508e-03 0.686 0.49306
Rainfall 6.189e-05 1.092e-04 0.567 0.57110
Bacteria 5.045e-05 6.062e-05 0.832 0.40562
Lead 1.230e-02 1.583e-02 0.777 0.43750
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.054 on 530 degrees of freedom
Multiple R-squared: 0.01924, Adjusted R-squared: 0.006291
F-statistic: 1.486 on 7 and 530 DF, p-value: 0.1697
fitted_vals <-fitted(model_multi)resid_vals <-residuals(model_multi)plot(fitted_vals, resid_vals,xlab ="Fitted values",ylab ="Residuals",main ="Residuals vs Fitted with Thick blue Smooth Line",pch =16, col ="darkgray", cex =0.9)sm <-lowess(fitted_vals, resid_vals, f =2/3) lines(sm, col ="blue", lwd =3)
shapiro.test(residuals(model_multi))
Shapiro-Wilk normality test
data: residuals(model_multi)
W = 0.95445, p-value = 7.817e-12
model <-lm( DissolvedOxygen ~ Nitrate + pH + Turbidity + Temperature + Rainfall + Bacteria + Lead,data = multi_data)summary(model)
Call:
lm(formula = DissolvedOxygen ~ Nitrate + pH + Turbidity + Temperature +
Rainfall + Bacteria + Lead, data = multi_data)
Residuals:
Min 1Q Median 3Q Max
-3.8303 -1.7388 -0.2013 1.8426 3.9137
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.128e+00 9.755e-01 6.282 6.97e-10 ***
Nitrate -1.770e-02 6.212e-03 -2.849 0.00456 **
pH 4.962e-02 1.229e-01 0.404 0.68663
Turbidity -2.686e-02 6.247e-02 -0.430 0.66734
Temperature 5.150e-03 7.508e-03 0.686 0.49306
Rainfall 6.189e-05 1.092e-04 0.567 0.57110
Bacteria 5.045e-05 6.062e-05 0.832 0.40562
Lead 1.230e-02 1.583e-02 0.777 0.43750
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.054 on 530 degrees of freedom
Multiple R-squared: 0.01924, Adjusted R-squared: 0.006291
F-statistic: 1.486 on 7 and 530 DF, p-value: 0.1697
shapiro.test(residuals(model))
Shapiro-Wilk normality test
data: residuals(model)
W = 0.95445, p-value = 7.817e-12