Report - Week 4

Introduction

According to the CDC, schistosomiasis is a disease caused by parasitic worms in humans, which is second only to malaria in terms of its devastating effect 1 CDC. (2021, January 13). CDC - Schistosomiasis. Www.cdc.gov. https://www.cdc.gov/parasites/schistosomiasis/index.html#:~:text=Schistosomiasis%2C%20also%20known%20as%20bilharzia. The three main species infecting humans are Schistosoma haematobium, Schistosoma japonicum, and Schistosoma mansoni. Risk factors for the disease include regions with poor sanitation and freshwater bodies.

Due to the devastating impacts of this disease, understanding the environments that help it spread can contribute to a more focused and effective prevention and mitigation strategy. Currently, the literature in the space consists of a landscape with several studies that hope to inform disease spread prevention. For instance, there have been geostatistical studies to understand schistosomiasis prevalence 2 Schur, N., Hürlimann, E., Garba, A., Traoré, M. S., Ndir, O., Ratard, R. C., Tchuem Tchuenté, L. A., Kristensen, T. K., Utzinger, J., & Vounatsou, P. (2011). Geostatistical model-based estimates of Schistosomiasis prevalence among individuals aged ≤ 20 years in West Africa. PLoS neglected tropical diseases, 5(6), e1194. https://doi.org/10.1371/journal.pntd.0001194, as well as spatial mapping of Schistosoma infection risk in east Africa 3 Schur, N., Hürlimann, E., Stensgaard, A. S., Chimfwembe, K., Mushinge, G., Simoonga, C., Kabatereine, N. B., Kristensen, T. K., Utzinger, J., & Vounatsou, P. (2013). Spatially explicit Schistosoma infection risk in eastern Africa using Bayesian geostatistical modelling. Acta tropica, 128(2), 365–377. https://doi.org/10.1016/j.actatropica.2011.10.006. However, there is a gap in the existing literature when it comes to the seasonal indices that influence the spread of the disease. My project aims to address this by examining the relationship of biological climate and environmental indicators.

Affiliations

For the SURP-Stats cohort of Summer 2024, I will be researching with the De Leo lab. The De Leo lab is led by Principal Investigator Dr. Giulio De Leo in the Stanford Doerr School of Sustainability. One of the main focuses of the lab is the control and elimination of infectious diseases with an important environmental component in their transmission cycle, with the most notable being schistosomiasis in West Africa. In the lab, I will be working with Project Manager, Andy Chamberlin.

My project for DATASCI 120 is going to be related to the work that I will be doing with the De Leo Lab in the summer so that I can gain some subject matter knowledge and be able to contribute more greatly to the lab with prior experience. The datasets and some analysis techniques were provided by the De Leo lab as these were specific insights they were interested in deriving. Due to these reasons, this project is affiliated with the De Leo Lab.

For the course of this project, I will be receiving feedback from Andy, who can be reached at .

Data Set, Research Question, and Hypotheses

The dataset that I will be using contains information about the source of schistosomiasis parasite prevalence and location data from West Africa. This dataset is sourced from the Global Neglected Tropical Disease database (GNTD). This dataset was accessed from GTND in 2016, and spans the years 1934-2010, with the majority of the data post-1980. The geophysical and climate variables were sampled at the point locations using Google Earth Engine. The data explores the relationship between two different parasites that cause schistosomiasis in humans: Schistosoma mansoni and Schistosoma haematobium, through spatial data, time, 19 climate predictor variables, and 9 terrain predictor variables.

My dataset is linked here.

The data dictionary that defines this dataset is linked here.

Based on this data, the primary research question that I hope to address is “what environmental and terrain features predict the presence of Schistoma mansoni and Schistosoma haematobium most effectively?”

I have three hypotheses that I hope to prove to accompany my research question investigation:

  1. Schistoma mansoni and Schistosoma haematobium have different sets of indices that predict them best.
  2. Since schistomiasis is known to spread through water, there is a higher risk of schistomiasis parasite presence closer to pH = 7.
  3. Following the same logic as Hypothesis 2, there is a higher risk of schistosomiasis presence in the periods with higher precipitation.

Exploratory Data Analysis

Originally, I had loaded in my dataset and RStudio read most of the variables as the wrong type. Therefore, I re-imported the dataset by making the necessary type changes to the code.

##   percent_pos       longitude          latitude         lat_long        
##  Min.   :  0.00   Min.   :-17.440   Min.   :-42.383   Length:11330      
##  1st Qu.:  0.00   1st Qu.: -3.706   1st Qu.: -1.307   Class :character  
##  Median :  8.15   Median : 11.450   Median :  7.364   Mode  :character  
##  Mean   : 21.87   Mean   : 13.390   Mean   :  4.574                     
##  3rd Qu.: 37.50   3rd Qu.: 32.760   3rd Qu.: 13.123                     
##  Max.   :100.00   Max.   : 47.433   Max.   : 20.258                     
##                                                                         
##    loc_spp           parasite_s          yearof_pub       bio01      
##  Length:11330       Length:11330       Min.   :   0   Min.   :12.08  
##  Class :character   Class :character   1st Qu.:1982   1st Qu.:23.00  
##  Mode  :character   Mode  :character   Median :1990   Median :25.91  
##                                        Mean   :1839   Mean   :25.10  
##                                        3rd Qu.:1996   3rd Qu.:27.40  
##                                        Max.   :2010   Max.   :30.43  
##                                                       NA's   :31     
##      bio02           bio03           bio04            bio05      
##  Min.   : 5.90   Min.   :43.00   Min.   : 1.469   Min.   :20.07  
##  1st Qu.:10.70   1st Qu.:57.00   1st Qu.:10.448   1st Qu.:31.30  
##  Median :13.00   Median :63.00   Median :18.046   Median :34.00  
##  Mean   :12.54   Mean   :65.46   Mean   :18.371   Mean   :34.66  
##  3rd Qu.:14.40   3rd Qu.:72.56   3rd Qu.:25.490   3rd Qu.:39.00  
##  Max.   :19.90   Max.   :91.87   Max.   :53.857   Max.   :42.60  
##  NA's   :31      NA's   :31      NA's   :31       NA's   :31     
##      bio06           bio07           bio08           bio09      
##  Min.   : 1.50   Min.   : 7.90   Min.   :11.26   Min.   :10.30  
##  1st Qu.:13.56   1st Qu.:14.50   1st Qu.:23.10   1st Qu.:21.90  
##  Median :15.30   Median :19.90   Median :25.70   Median :24.60  
##  Mean   :15.11   Mean   :19.54   Mean   :25.09   Mean   :23.72  
##  3rd Qu.:17.50   3rd Qu.:24.25   3rd Qu.:27.20   3rd Qu.:26.30  
##  Max.   :22.90   Max.   :31.10   Max.   :35.60   Max.   :31.87  
##  NA's   :31      NA's   :31      NA's   :31      NA's   :31     
##      bio10           bio11           bio12          bio13       
##  Min.   :13.28   Min.   :10.30   Min.   :  11   Min.   :   3.0  
##  1st Qu.:24.60   1st Qu.:21.50   1st Qu.: 615   1st Qu.: 167.4  
##  Median :27.60   Median :23.43   Median : 977   Median : 216.0  
##  Mean   :27.35   Mean   :22.66   Mean   :1043   Mean   : 230.5  
##  3rd Qu.:30.50   3rd Qu.:24.96   3rd Qu.:1314   3rd Qu.: 282.0  
##  Max.   :36.15   Max.   :28.70   Max.   :4226   Max.   :1139.4  
##  NA's   :31      NA's   :31      NA's   :31     NA's   :31      
##      bio14            bio15            bio16            bio17       
##  Min.   : 0.000   Min.   : 25.16   Min.   :   7.0   Min.   :  0.00  
##  1st Qu.: 0.000   1st Qu.: 66.00   1st Qu.: 408.0   1st Qu.:  0.00  
##  Median : 1.000   Median : 99.00   Median : 536.2   Median :  6.00  
##  Mean   : 8.618   Mean   : 98.11   Mean   : 573.4   Mean   : 39.41  
##  3rd Qu.:13.000   3rd Qu.:128.00   3rd Qu.: 694.0   3rd Qu.: 64.00  
##  Max.   :94.000   Max.   :183.00   Max.   :2798.8   Max.   :337.74  
##  NA's   :31       NA's   :31       NA's   :31       NA's   :31      
##      bio18            bio19             hnd               upa           
##  Min.   :  4.00   Min.   :   0.0   Min.   :  0.000   Min.   :     0.01  
##  1st Qu.: 92.34   1st Qu.:   2.0   1st Qu.:  2.267   1st Qu.:     0.01  
##  Median :188.00   Median :  26.0   Median :  6.740   Median :     0.03  
##  Mean   :212.19   Mean   : 223.8   Mean   : 14.653   Mean   :   161.65  
##  3rd Qu.:301.00   3rd Qu.: 380.6   3rd Qu.: 16.476   3rd Qu.:     0.10  
##  Max.   :996.00   Max.   :2798.8   Max.   :408.948   Max.   :276274.60  
##  NA's   :31       NA's   :31       NA's   :25        NA's   :25         
##      slope             gHM           elevation              pH       
##  Min.   : 0.000   Min.   :0.0000   Min.   :  -2.748   Min.   :4.024  
##  1st Qu.: 1.256   1st Qu.:0.3145   1st Qu.: 195.749   1st Qu.:5.601  
##  Median : 1.891   Median :0.5270   Median : 365.933   Median :6.023  
##  Mean   : 2.793   Mean   :0.5062   Mean   : 565.760   Mean   :6.116  
##  3rd Qu.: 3.002   3rd Qu.:0.6850   3rd Qu.: 950.891   3rd Qu.:6.501  
##  Max.   :47.420   Max.   :0.9630   Max.   :3181.426   Max.   :9.039  
##  NA's   :24       NA's   :79       NA's   :24         NA's   :169    
##      aspect           clay            sand      
##  Min.   :  0.0   Min.   : 0.00   Min.   :16.13  
##  1st Qu.:116.4   1st Qu.:17.99   1st Qu.:47.65  
##  Median :166.0   Median :23.90   Median :56.85  
##  Mean   :167.1   Mean   :25.09   Mean   :56.45  
##  3rd Qu.:217.4   3rd Qu.:31.88   3rd Qu.:65.47  
##  Max.   :350.1   Max.   :58.72   Max.   :99.00  
##  NA's   :24      NA's   :169     NA's   :169

It is interesting to see that the number of NA’s have a pattern that corresponds to the different Google Earth Engine libraries used. For example, the “clay” and “sand” variables are derived from the same Google Earth Engine library and both have 169 NA’s. Another example of this can be seen through the DEM-derived variables (slope, elevation, and aspect), which all have 24 NA’s. All missing values are summarized and dealt with as “NA”s in the summary table.

Variable 1: percent_pos

It is defined as aggregated schistosomiasis parasitology study percentage positivity of parasite presence at each “loc_spp.” This data is collected from the GNTD database mentioned earlier. It is a quantitative variable whose values range from 0 to 100 with units in percentage. The distribution of the values of the variable can be plotted for greater insight:

Variable 2: Longitude

This contains the longitude coordinates of each observation. This data is collected from the GNTD database mentioned earlier. It is a quantitative variable whose values range from -180 to 180 with units in degrees. The distribution of the values of the variable can be plotted for greater insight:

Since the dataset primarily represents data from Africa, the longitudes seem to be concentrated there.

Variable 3: Latitude

This contains the latitude coordinates of each observation. This data is collected from the GNTD database mentioned earlier. It is a quantitative variable whose values range from -90 to 90 with units in degrees. The distribution of the values of the variable can be plotted for greater insight:

Since the dataset primarily represents data from Africa, the latitudes seem the be concentrated there.

Variable 4: lat_long

The latitude-longitude coordinates are merged into one column. I don’t think I will be using this data at this point since I already have the latitude and longitude columns separately. Hence, I will not be plotting it or describing it again in this report after already mentioning it in the data dictionary.

Variable 5: loc_spp

This column contains the latitude-longitude coordinates for each location and also contains the species of parasite: Schistosoma haematobium, Schistosoma mansoni or Schistosoma intercalatum. I don’t think I will be using this data at this point since I already have the latitude, longitude, and specie columns separately. Hence, I will not be plotting it or describing it again in this report after already mentioning it in the data dictionary.

Variable 6: parasite_s

This contains the parasite species for each observation. This data is collected from the GNTD database mentioned earlier. It is a qualitative variable whose categories are Schistosoma haematobium, Schistosoma mansoni or Schistosoma intercalatum. The distribution of the values of the variable can be plotted for greater insight:

Variable 7: yearof_pub

This contains the year each study was published. This data is collected from the GNTD database mentioned earlier. It is a quantitative variable whose values can range from 1900 to 2010. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 856 rows containing non-finite outside the scale range
## (`stat_bin()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_bar()`).

Variable 8: bio01

This contains the annual mean temperature. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -29 to 32 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 9: bio02

This contains the mean diurnal range. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0.9 to 21.4 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 10: bio03

This contains the isothermality of each observation. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 7 to 96 with units in percentage. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 11: bio04

This contains the Temperature seasonality of each observation, which is just the standard deviation * 100. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0.6 to 227 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 12: bio05

This contains the Max temperature of warmest month. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -9.6 to 49 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 13: bio06

This contains the Min temperature of coldest month. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -57.3 to 25.8 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 14: bio07

This contains the Temperature annual range. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 5.3 to 72.5 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 15: bio08

This contains the mean temperature of wettest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -28.5 to 37.8 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 16: bio09

This contains the Mean temperature of driest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -52.1 to 36.6 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 17: bio10

This contains the Mean temperature of warmest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -14.3 to 38.3 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

# Variable 18: bio11

This contains the Mean temperature of coldest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from -52.1 to 28.9 with units in degree celsius. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 19: bio12

This contains the annual precipitation. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 11401 with units in millimeters. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 20: bio13

This contains the Precipitation of wettest month. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 2949 with units in millimeters. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 21: bio14

This contains the Precipitation of driest month. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 752 with units in millimeters. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 22: bio15

This contains the precipitation seasonality. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 265 with units as coefficient of variation. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 23: bio16

This contains the precipitation of wettest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 8019 with units as millimeter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 24: bio17

This contains the precipitation of driest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 2495 with units as millimeter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 25: bio18

This contains the precipitation of warmest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 6090 with units as millimeter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 26: bio19

This contains the precipitation of coldest quarter. This data is collected from the Google Earth Engine “WorldClim BIO Variables V1” dataset provided by UC Berkeley. It is a quantitative variable whose values range from 0 to 5162 with units as millimeter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 31 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 27: hnd

This contains the hydrologically adjusted elevation, also know as “hand” (height above the nearest drainage). This data is collected from the Google Earth Engine “MERIT Hydro: Global Hydrography Datasets” dataset provided by University of Tokyo. It is a quantitative variable whose values range from 0 to 90 with units as meter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 25 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 28: upa

This contains the upstream drainage area (flow accumulation area). This data is collected from the Google Earth Engine “MERIT Hydro: Global Hydrography Datasets” dataset provided by University of Tokyo. It is a quantitative variable whose values range from 0 to 200 with units as kilometer^2. The distribution of the values is described in the summary table at the start of this report - there was an error I was getting when trying to generate this histogram. I hope to address the issue in Office Hours can provide an update in my report for Week 5.

Variable 29: slope

This contains the slope of terrain (digital elevation model [DEM]-derived). This data is collected from the Google Earth Engine “SRTM Digital Elevation Data Version 4” dataset provided by NASA. It is a quantitative variable whose values range from 0 to 90 with units as degrees. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 24 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 30: gHM

This contains the global human modification: a cumulative measure of human modification of terrestrial lands globally at 1 square-kilometer resolution. This data is collected from the Google Earth Engine “CSP gHM: Global Human Modification” dataset provided by Conservation Science Partners. It is a quantitative variable whose values range from 0 to 1 with units as kilometer^2. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 79 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 31: elevation

This contains the elevation of terrain (digital elevation model [DEM]-derived). This data is collected from the Google Earth Engine “SRTM Digital Elevation Data Version 4” dataset provided by NASA. It is a quantitative variable whose values range from -444 to 8806 with units as meter. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 24 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 32: pH

This contains the metric to measure soil acidity - this data had to be transformed by scaling the values by 0.1 to represent a regular pH scale which I did through Excel. This data is collected from the Google Earth Engine “OpenLandMap Soil pH in H2O” dataset provided by EnvirometriX Ltd. It is a qualitative variable whose values range from 0 to 14 with 1 unit increments (eg. 1, 2, …, 13, 14). The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 169 rows containing non-finite outside the scale range
## (`stat_bin()`).

Note: Even though this is a qualitative variable, I plotted it as a histogram because the pH could be any value from 0 - 14. I hope to clarify my approach with regards to this variable in Office Hours and include it in my Week 5 report.

Variable 33: aspect

This contains the aspect of terrain (digital elevation model [DEM]-derived). This data is collected from the Google Earth Engine “SRTM Digital Elevation Data Version 4” dataset provided by NASA. It is a quantitative variable whose values range from 0 to 360 with units as degrees. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 24 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 34: clay

This contains how much of the soil content is clay. This data is collected from the Google Earth Engine “OpenLandMap Clay Content” dataset provided by EnvirometriX Ltd. It is a quantitative variable whose values range from 0 to 100 as a percentage. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 169 rows containing non-finite outside the scale range
## (`stat_bin()`).

Variable 35: sand

This contains how much of the soil content is sand. This data is collected from the Google Earth Engine “OpenLandMap Sand Content” dataset provided by EnvirometriX Ltd. It is a quantitative variable whose values range from 0 to 100 as a percentage. The distribution of the values of the variable can be plotted for greater insight:

## Warning: Removed 169 rows containing non-finite outside the scale range
## (`stat_bin()`).

Quality Control

The first step of quality control is imputing the NaN values as per the summary table provided at the start of the exploratory data analysis.

pH, clay, and sand have 169 missing values. Since these factors are so heavily dependant on location, I am going to fill in thos missing values with the average of the 10 nearest neighbors of those observations in terms of longitude and latitude.

##   pH clay sand 
##    0    0    0

The biological climate variables, “bio01” to “bio19”, have 31 missing values. Upon investigation, I saw that these missing values were all in the same observation. Because of this, I decided to remove those 31 observations entirely as none of them would have recorded data for those 19 variables. My dataset size was reduced from 11,330 observations to 11,299 observations.

## [1] 11299    35

“hnd” and “upa” both had 25 missing values. Since the hydrological metrics of a particular region would be similar to the geography around it, I handled these values through the 10 nearest neighbors average method based on longitude and latitude.

## hnd upa 
##   0   0

“Slope,” “elevation,” and “aspect” all had 24 missing values. Since the landscape metrics of a particular region would be similar to the geography around it, I handled these values through the 10 nearest neighbors average method based on longitude and latitude.

##     slope elevation    aspect 
##         0         0         0

Lastly, “gHM” had 55 missing values. Since the human modification and terrain metrics of a particular region would be similar to the locations close to it, I handled these values through the 10 nearest neighbors average method based on longitude and latitude.

## gHM 
##   0
##   percent_pos       longitude          latitude         lat_long        
##  Min.   :  0.00   Min.   :-17.440   Min.   :-25.967   Length:11299      
##  1st Qu.:  0.00   1st Qu.: -3.708   1st Qu.: -1.296   Class :character  
##  Median :  8.10   Median : 11.450   Median :  7.370   Mode  :character  
##  Mean   : 21.87   Mean   : 13.378   Mean   :  4.594                     
##  3rd Qu.: 37.50   3rd Qu.: 32.750   3rd Qu.: 13.128                     
##  Max.   :100.00   Max.   : 47.433   Max.   : 20.258                     
##    loc_spp           parasite_s          yearof_pub       bio01      
##  Length:11299       Length:11299       Min.   :   0   Min.   :12.08  
##  Class :character   Class :character   1st Qu.:1982   1st Qu.:23.00  
##  Mode  :character   Mode  :character   Median :1990   Median :25.91  
##                                        Mean   :1839   Mean   :25.10  
##                                        3rd Qu.:1996   3rd Qu.:27.40  
##                                        Max.   :2010   Max.   :30.43  
##      bio02           bio03           bio04            bio05      
##  Min.   : 5.90   Min.   :43.00   Min.   : 1.469   Min.   :20.07  
##  1st Qu.:10.70   1st Qu.:57.00   1st Qu.:10.448   1st Qu.:31.30  
##  Median :13.00   Median :63.00   Median :18.046   Median :34.00  
##  Mean   :12.54   Mean   :65.46   Mean   :18.371   Mean   :34.66  
##  3rd Qu.:14.40   3rd Qu.:72.56   3rd Qu.:25.490   3rd Qu.:39.00  
##  Max.   :19.90   Max.   :91.87   Max.   :53.857   Max.   :42.60  
##      bio06           bio07           bio08           bio09      
##  Min.   : 1.50   Min.   : 7.90   Min.   :11.26   Min.   :10.30  
##  1st Qu.:13.56   1st Qu.:14.50   1st Qu.:23.10   1st Qu.:21.90  
##  Median :15.30   Median :19.90   Median :25.70   Median :24.60  
##  Mean   :15.11   Mean   :19.54   Mean   :25.09   Mean   :23.72  
##  3rd Qu.:17.50   3rd Qu.:24.25   3rd Qu.:27.20   3rd Qu.:26.30  
##  Max.   :22.90   Max.   :31.10   Max.   :35.60   Max.   :31.87  
##      bio10           bio11           bio12          bio13       
##  Min.   :13.28   Min.   :10.30   Min.   :  11   Min.   :   3.0  
##  1st Qu.:24.60   1st Qu.:21.50   1st Qu.: 615   1st Qu.: 167.4  
##  Median :27.60   Median :23.43   Median : 977   Median : 216.0  
##  Mean   :27.35   Mean   :22.66   Mean   :1043   Mean   : 230.5  
##  3rd Qu.:30.50   3rd Qu.:24.96   3rd Qu.:1314   3rd Qu.: 282.0  
##  Max.   :36.15   Max.   :28.70   Max.   :4226   Max.   :1139.4  
##      bio14            bio15            bio16            bio17       
##  Min.   : 0.000   Min.   : 25.16   Min.   :   7.0   Min.   :  0.00  
##  1st Qu.: 0.000   1st Qu.: 66.00   1st Qu.: 408.0   1st Qu.:  0.00  
##  Median : 1.000   Median : 99.00   Median : 536.2   Median :  6.00  
##  Mean   : 8.618   Mean   : 98.11   Mean   : 573.4   Mean   : 39.41  
##  3rd Qu.:13.000   3rd Qu.:128.00   3rd Qu.: 694.0   3rd Qu.: 64.00  
##  Max.   :94.000   Max.   :183.00   Max.   :2798.8   Max.   :337.74  
##      bio18            bio19             hnd               upa           
##  Min.   :  4.00   Min.   :   0.0   Min.   :  0.000   Min.   :     0.01  
##  1st Qu.: 92.34   1st Qu.:   2.0   1st Qu.:  2.267   1st Qu.:     0.01  
##  Median :188.00   Median :  26.0   Median :  6.740   Median :     0.03  
##  Mean   :212.19   Mean   : 223.8   Mean   : 14.656   Mean   :   161.74  
##  3rd Qu.:301.00   3rd Qu.: 380.6   3rd Qu.: 16.477   3rd Qu.:     0.10  
##  Max.   :996.00   Max.   :2798.8   Max.   :408.948   Max.   :276274.60  
##      slope             gHM           elevation              pH       
##  Min.   : 0.000   Min.   :0.0000   Min.   :  -2.748   Min.   :4.024  
##  1st Qu.: 1.256   1st Qu.:0.3147   1st Qu.: 196.086   1st Qu.:5.602  
##  Median : 1.891   Median :0.5264   Median : 366.192   Median :6.018  
##  Mean   : 2.794   Mean   :0.5060   Mean   : 566.103   Mean   :6.116  
##  3rd Qu.: 3.002   3rd Qu.:0.6845   3rd Qu.: 952.402   3rd Qu.:6.501  
##  Max.   :47.420   Max.   :0.9630   Max.   :3181.426   Max.   :9.039  
##      aspect           clay            sand      
##  Min.   :  0.0   Min.   : 0.00   Min.   :16.13  
##  1st Qu.:116.4   1st Qu.:18.00   1st Qu.:47.47  
##  Median :166.0   Median :23.92   Median :56.79  
##  Mean   :167.1   Mean   :25.12   Mean   :56.40  
##  3rd Qu.:217.4   3rd Qu.:31.99   3rd Qu.:65.33  
##  Max.   :350.1   Max.   :58.72   Max.   :99.00

This concludes the section of quality control dealing with missing values as there are no more missing values left in my dataset.

There were no obvious outliers in the dataset. I would also include them in my dataset because they could be good examples to uncover some unique characteristic behind the spread of schistosomiasis and parasite prevalence.

Relationships

To test Hypothesis 2, I thought that it would be a good idea to plot the correlation of pH and percent_pos.

The correlation plot shows how there is a higher concentration of points in the pH 5 - 7 range. This is further confirmed by the graph of the points representing average percent positivity per pH bucket. This disproved Hypothesis 2, which expected that there would be a higher percentage positivity closer to pH = 7. Through these visualizations, the highest average percentage positivity found in the pH 9 to 9.5 range.

To test Hypothesis 3, I will be plotting a correlation plot between “bio12,” the mean annual precipitation, and percent_pos.

## 
##  Pearson's product-moment correlation
## 
## data:  Datasci120_Dataset$pH and Datasci120_Dataset$percent_pos
## t = 8.6014, df = 11297, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.06231608 0.09895414
## sample estimates:
##        cor 
## 0.08066236

The correlation test signifies a very weak positively linear correlation between mean annual precipitation and percent_pos. The Pearson’s Correlation Co-efficient is 0.081 with a p-value of 2.2e-16 < 0.05, exhibiting statistical significance. I feel like I still want to investigate this hypothesis more to display a clearer image. I believe some other sort of causal method is necessary which takes into account other precipitation variables.

With this result in mind, I need to consider new ways to account for all the variables linked to an environmental condition (eg. precipitation). I will be discussing this further with Andy. Based on our discussion, I will revise my hypotheses for Week 5.

Analysis Steps

So far, I was considering using Pearsons Correlation Correlation and p-test to display relationships between percent_pos and other indicator variables that we are planning on investigating. Additionally, I am also going to build many different models in order to try and develop a framework for predicting percent_pos using different indicators. I have tried the first analysis method above and taken the first step, but will discuss and plan future analyses with Andy to include in my report for Week 5.

For this report, I was able to incorporate all the feedback given in my report for Week 3 including correlation plots, removing code output, and captioning the figures with continuous numbering.