Exploratory Data Analysis

Datasets

We have two datesets:
1. Injectable Opioid Users 2. Alcohol Users with no recorded history of opioid or injectable drug use.
We have collected the latitude and longitude of thier reported residence using Google Geocode API [https://developers.google.com/maps/documentation/geocoding/overview]. We have then pruned both the datasets to include cases within 100 kms radius of Bangalore Municipal Boundaries. See the code to follow along.

opioidDataset <- read.csv(file.path(tempDirectory,"opioidsAddressData.csv"))
opioidDataset <- rename(opioidDataset,
                        "lat"="lat1")
opioidDataset <- rename(opioidDataset,
                        "lon"="lon1")
opioidDataset$case = TRUE
alcoholDataset <- read.csv(file.path(tempDirectory,"alcoholAddressData.csv")) #10424
alcoholDataset$case <- FALSE
alcoholDataset$HCV_Status <- FALSE

There are 402 opioid cases overall and 10424 alcohol cases.

bangBoundry = list(
  "lonLower"=77.026520,
  "lonUpper"=78.182831,
  "latLower"=12.153785,
  "latUpper"=13.593692
)
opioidDataset <- opioidDataset %>%
  filter(between(lon,bangBoundry$lonLower,bangBoundry$lonUpper)& between(lat,bangBoundry$latLower,
                                                                             bangBoundry$latUpper))# 206
alcoholDataset <- alcoholDataset %>%
  filter(between(lon,bangBoundry$lonLower,bangBoundry$lonUpper)& between(lat,bangBoundry$latLower,
                                                                             bangBoundry$latUpper)) #6774

After filtering for cases within 100 kms radius of Bangalore boundaries we have 206 opioid cases and 6744 alcohol controls. We will be randomly choosing 206 alcohol controls for inclusion in the analysis.

ind <- sample(1:nrow(alcoholDataset),nrow(opioidDataset))
alcoholDataset <- alcoholDataset[ind,]
fullDataset <- bind_rows(alcoholDataset,opioidDataset)

Visualisation of spatial distribution of cases (IDU Opioids) and Controls (Alcohol)

CaseControl_SPDF <- SpatialPointsDataFrame(coords = fullDataset[,c("lon", "lat")],
                                           data = fullDataset)
case_color_scheme <- colorNumeric(c("blue", "red"), CaseControl_SPDF$case)
leaflet() %>% addTiles() %>% addCircleMarkers(data=CaseControl_SPDF, 
                                              color = case_color_scheme(CaseControl_SPDF$case),
                                              radius = 1)

Analysis 1: Are IDU more clustered than controls (Alcohol users)?

CaseControlPPP<-ppp(fullDataset$lon, fullDataset$lat, 
                    range(fullDataset$lon), 
                    range(fullDataset$lat), 
                    marks = as.factor(fullDataset$case))
kdest = kdest(CaseControlPPP,nsim=999, level=0.95, correction=c("isotropic", "Ripley"))
## Generating 999 simulations by evaluating expression  ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
## 
## Done.
kdplus.test(kdest) #p < 0.001
## 
## Diggle and Chetwynd (1991) test for difference in K functions
## 
## KD(r) = K_case(r) - K_control(r)
## case label:  TRUE 
## control label:  FALSE 
## 
## null hypothesis: KD(r) = 0 for all r between 0 and 0.2828519 
## alternative hypothesis: KD(r) > 0 for at least one r between 0 and 0.2828519 
## test statistic: 2841.188 
## p-value: 0.001 
## nsim: 999 
## simulation procedure: random labeling

K Statistic is a measure of density. K function is calculating density at varying distances from a case or control. If the K value is high at shorter distances from a case/control it means there is higher than expected number of events. This is evidence of clustering. In the test, we use simulation to test how likely is it that K function of cases and controls are same i.e. there is no clustering of cases. The answer shows that we can reject the null hypothesis as cases show clustering.
A look at the K function plot shows that density of cases is much higher than controls.

plot(kdest)

INFERENCE: IDU as a phenomenon shows clutsering in comparison to another SUD like alcohol use.
IMPLICATIONS: These hot spots must receive concentrated input from addiction and public health services.
A density overlay shows the concentration of IDU’s in Byrasandra Tavarkere and Madiwala regions (BTM layout).

cases <- fullDataset[fullDataset$case,]
Cases_ppp <- ppp(cases$lon, cases$lat,range(cases$lon),range(cases$lat))
density_raster <- raster(density(Cases_ppp,0.02))
crs(density_raster) <- "+proj=longlat +datum=WGS84"
colpal <- colorNumeric(palette=tim.colors(64), domain=values(density_raster), na.color = NA)
leaflet() %>% addTiles() %>% addRasterImage(density_raster, opacity=0.6,colors = colpal)

Are HCV patients more clustered than controls (alcohol users)?

For this analysis we first create a dataset that includes HCV positive cases and alcohol users. But excludes IDU who are HCV negative. Read the code to follow along.

subDataset <- fullDataset %>%
  filter(!(case&!HCV_Status))
CaseControlPPPHCV<-ppp(subDataset$lon, subDataset$lat, 
                    range(subDataset$lon), 
                    range(subDataset$lat), 
                    marks = as.factor(subDataset$HCV_Status))
kdestHCV = kdest(CaseControlPPPHCV,nsim=999, level=0.95, correction=c("isotropic", "Ripley"))
## Generating 999 simulations by evaluating expression  ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
## 
## Done.
kdplus.test(kdestHCV) #p < 0.001
## 
## Diggle and Chetwynd (1991) test for difference in K functions
## 
## KD(r) = K_case(r) - K_control(r)
## case label:  TRUE 
## control label:  FALSE 
## 
## null hypothesis: KD(r) = 0 for all r between 0 and 0.2688797 
## alternative hypothesis: KD(r) > 0 for at least one r between 0 and 0.2688797 
## test statistic: 3176.441 
## p-value: 0.001 
## nsim: 999 
## simulation procedure: random labeling

It is clear that there is clustering of HCV cases as seen by a p value of 0.001. The plot also shows the same findings.

plot(kdestHCV)

INFERENCE: HCV cases show substantial clustering as compared to a proxy measure of population density which is Alcohol users in this case.
IMPLICATION: Opportunisic screening, awareness generation and provision of anti-virals should be done in earnest at these high transmission areas.
A density overlay shows more or less an overlap between IDU and HCV hotspots. This map may help in selecting areas for intervention.

cases <- fullDataset[fullDataset$HCV_Status,]
Cases_ppp <- ppp(cases$lon, cases$lat,range(cases$lon),range(cases$lat))
density_raster <- raster(density(Cases_ppp,0.02))
crs(density_raster) <- "+proj=longlat +datum=WGS84"
colpal <- colorNumeric(palette=tim.colors(64), domain=values(density_raster), na.color = NA)
leaflet() %>% addTiles() %>% addRasterImage(density_raster, opacity=0.6,colors = colpal)

Are HCV patients even more clustered than IDU (are there particularly high transmission areas within IDU hotspots?)

For this analysis we have used all IDU’s as population of interest. HCV positive status is caseness and negative is control.

opioidDataset <- read.csv(file.path(tempDirectory,"opioidsAddressData.csv"))
opioidDataset <- rename(opioidDataset,
                        "lat"="lat1")
opioidDataset <- rename(opioidDataset,
                        "lon"="lon1")
CaseControl_SPDF <- SpatialPointsDataFrame(coords = opioidDataset[,c("lon", "lat")],
                                           data = opioidDataset)
case_color_scheme <- colorNumeric(c("blue", "red"), CaseControl_SPDF$HCV_Status)
leaflet() %>% addTiles() %>% addCircleMarkers(data=CaseControl_SPDF, 
                                              color = case_color_scheme(CaseControl_SPDF$HCV_Status),
                                              radius = 1)

No clear inference can be drawn from this exploratory analysis as both IDU and HCV cases show clustering which are largely overlapping.

CaseControlPPPHCV<-ppp(opioidDataset$lon, opioidDataset$lat, 
                    range(opioidDataset$lon), 
                    range(opioidDataset$lat), 
                    marks = as.factor(opioidDataset$HCV_Status))
kdestHCV = kdest(CaseControlPPPHCV,nsim=999, level=0.95, correction=c("isotropic", "Ripley"))
## Generating 999 simulations by evaluating expression  ...
## 1, 2, 3, ......10.........20.........30.........40.........50.........60........
## .70.........80.........90.........100.........110.........120.........130......
## ...140.........150.........160.........170.........180.........190.........200....
## .....210.........220.........230.........240.........250.........260.........270..
## .......280.........290.........300.........310.........320.........330.........340
## .........350.........360.........370.........380.........390.........400........
## .410.........420.........430.........440.........450.........460.........470......
## ...480.........490.........500.........510.........520.........530.........540....
## .....550.........560.........570.........580.........590.........600.........610..
## .......620.........630.........640.........650.........660.........670.........680
## .........690.........700.........710.........720.........730.........740........
## .750.........760.........770.........780.........790.........800.........810......
## ...820.........830.........840.........850.........860.........870.........880....
## .....890.........900.........910.........920.........930.........940.........950..
## .......960.........970.........980.........990........ 999.
## 
## Done.
kdplus.test(kdestHCV) 
## 
## Diggle and Chetwynd (1991) test for difference in K functions
## 
## KD(r) = K_case(r) - K_control(r)
## case label:  TRUE 
## control label:  FALSE 
## 
## null hypothesis: KD(r) = 0 for all r between 0 and 5.219674 
## alternative hypothesis: KD(r) > 0 for at least one r between 0 and 5.219674 
## test statistic: 1359.52 
## p-value: 0.002 
## nsim: 999 
## simulation procedure: random labeling

However a statistical test shows that there is a clustering of HCV positives within the larger clusters of IDU. Larger dataset will be needed to locate and quantify these clusters of high HCV transmission areas within IDU areas.

INFERENCE: HCV positivity shows clustering even relative to IDU.

IMPLICATIONS: There may be particularly risky groups of users living in certain areas that are driving the HCV transmission. These areas will yield good rewards for door-to-door or peer-led interventions to get these patients on antivirals.