Introduction:

Research Question: How well do water use efficiency, industrial water use efficiency, and agricultural water withdrawal predict water stress across countries in 2023?

For this project, I used the AQUASTAT dataset from the Food and Agriculture Organization (FAO). The dataset has 5,358 rows and 10 columns and contains water information for different countries and areas from 2021 to 2023. For my analysis, I used water stress, water use efficiency, industrial water use efficiency, and agricultural water withdrawal. I chose this topic because water is an important resource around the world. I wanted to see which water-related factors are connected to higher water stress.

Data Analysis:

Before doing the regression, I cleaned the data set. I used filter() to keep the 2023 data and remove aggregate areas. I used select() to keep the columns I needed and mutate() to make sure Value was numeric. Then, I selected the four variables for my analysis, changed them into separate columns, and removed missing values.

loading Data:

library(tidyverse) 
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.1     ✔ readr     2.2.0
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.3     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ tidyr     1.3.2
## ✔ purrr     1.2.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
water <- read_csv("AQUASTAT Dissemination System.csv")
## Rows: 5358 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (6): VariableGroup, Subgroup, Variable, Area, Unit, Symbol
## dbl (3): m49, Year, Value
## lgl (1): IsAggregate
## 
## ℹ 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.

Cleaning Data:

water_2023 <- water |>
  
  filter(Year == 2023, IsAggregate == FALSE) |>
  
  select(Area, Variable, Value) |> 
  
  mutate(Value = as.numeric(Value))

Preparing Variables:

water_clean <- water_2023 |> 
  filter(Variable %in% c( 
    "SDG 6.4.2. Water Stress", 
    "SDG 6.4.1. Water Use Efficiency",     "SDG 6.4.1. Industrial Water Use Efficiency",
    "Agricultural water withdrawal as % of total renewable water resources" )) |> 
  
  pivot_wider( 
    names_from = Variable,                 values_from = Value ) |>
  drop_na() 
dim(water_clean)
## [1] 168   5

Statistical Analysis:

I used Multiple Regression because I wanted to see how several independent variables predict one continuous dependent variable. My dependent variable is water stress. My three independent variables are water use efficiency, industrial water use efficiency, and agricultural water withdrawal.

My model is:

Water Stress = β₀ + β₁(Water Use Efficiency) + β₂(Industrial Water Use Efficiency) + β₃(Agricultural Water Withdrawal) + ε

Multiple Regression:

model <- lm( 
  `SDG 6.4.2. Water Stress` ~ 
  `SDG 6.4.1. Water Use Efficiency` +    `SDG 6.4.1. Industrial Water Use Efficiency` + 
  `Agricultural water withdrawal as % of total renewable water resources`, data = water_clean ) 

summary(model)
## 
## Call:
## lm(formula = `SDG 6.4.2. Water Stress` ~ `SDG 6.4.1. Water Use Efficiency` + 
##     `SDG 6.4.1. Industrial Water Use Efficiency` + `Agricultural water withdrawal as % of total renewable water resources`, 
##     data = water_clean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -114.929  -12.344   -7.942    8.245  112.567 
## 
## Coefficients:
##                                                                           Estimate
## (Intercept)                                                             15.5431040
## `SDG 6.4.1. Water Use Efficiency`                                       -0.0176561
## `SDG 6.4.1. Industrial Water Use Efficiency`                            -0.0002178
## `Agricultural water withdrawal as % of total renewable water resources`  0.9962050
##                                                                         Std. Error
## (Intercept)                                                              1.9815428
## `SDG 6.4.1. Water Use Efficiency`                                        0.0126794
## `SDG 6.4.1. Industrial Water Use Efficiency`                             0.0004210
## `Agricultural water withdrawal as % of total renewable water resources`  0.0054877
##                                                                         t value
## (Intercept)                                                               7.844
## `SDG 6.4.1. Water Use Efficiency`                                        -1.393
## `SDG 6.4.1. Industrial Water Use Efficiency`                             -0.517
## `Agricultural water withdrawal as % of total renewable water resources` 181.533
##                                                                         Pr(>|t|)
## (Intercept)                                                              5.3e-13
## `SDG 6.4.1. Water Use Efficiency`                                          0.166
## `SDG 6.4.1. Industrial Water Use Efficiency`                               0.606
## `Agricultural water withdrawal as % of total renewable water resources`  < 2e-16
##                                                                            
## (Intercept)                                                             ***
## `SDG 6.4.1. Water Use Efficiency`                                          
## `SDG 6.4.1. Industrial Water Use Efficiency`                               
## `Agricultural water withdrawal as % of total renewable water resources` ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.41 on 164 degrees of freedom
## Multiple R-squared:  0.9951, Adjusted R-squared:  0.995 
## F-statistic: 1.102e+04 on 3 and 164 DF,  p-value: < 2.2e-16

Interpretation Results:

The model had an R-squared of about 0.995. This means that about 99.5% of the variation in water stress is explained by the three independent variables in this model. Agricultural water withdrawal had a coefficient of about 0.996 and a p-value less than 0.001. This means that higher agricultural water withdrawal was associated with higher water stress, while holding the other variables constant. Water use efficiency had a coefficient of about -0.018 and a p-value of about 0.166. Industrial water use efficiency had a coefficient close to 0 and a p-value of about 0.606. Since both p-values are greater than 0.05, they were not statistically significant predictors in this model.

Checking Regression Assumptions

par(mfrow = c(2, 2)) 

par(mfrow = c(1,1))
plot(model)

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

The Residuals vs. Fitted plot does not show a completely random pattern. There is a large cluster on 0. This suggests that the linearity assumption may not be fully met.

The Normal Q-Q plot shows that most points are near the line, but there are some points that move away from the line. This means the residuals are not perfectly normally distributed.

The Scale-Location plot shows that the spread of the residuals changes as the fitted values increase. This suggests that the homoscedasticity assumption may not be fully met.

The Residuals vs. Leverage plot shows a few observations that may have more influence on the model than others. These observations should be considered when interpreting the results.

Independence and Multicollinearity

library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## The following object is masked from 'package:purrr':
## 
##     some
durbinWatsonTest(model) 
##  lag Autocorrelation D-W Statistic p-value
##    1     -0.09168318      2.181554    0.24
##  Alternative hypothesis: rho != 0
vif(model)
##                                       `SDG 6.4.1. Water Use Efficiency` 
##                                                                1.005707 
##                            `SDG 6.4.1. Industrial Water Use Efficiency` 
##                                                                1.009099 
## `Agricultural water withdrawal as % of total renewable water resources` 
##                                                                1.004191

The Durbin-Watson value is about 2.18. Since this is close to 2, independence does not appear to be a major problem. The VIF values for the three independent variables are close to 1. This means that there is no major multicollinearity problem between the predictors.

Conclusion:

The purpose of this project was to see how well three water-related variables predict water stress across countries in 2023. The Multiple Regression model explained about 99.5% of the variation in water stress. Agricultural water withdrawal was a statistically significant predictor of water stress. Water use efficiency and industrial water use efficiency were not statistically significant predictors. Overall, the results suggest that agricultural water withdrawal has a strong relationship with water stress in this data set. One limitation is that I only used data from 2023, and the residuals were not perfectly normal. For future research, I could include more years of data and other variables that may help explain water stress.

References:

Food and Agriculture Organization of the United Nations. AQUASTAT Dissemination System. https://data.apps.fao.org/aquastat/?lang=en&share=f-54b029ee-2fd5-4595-bcda-86367969727a

R Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing.