Did the Kigadi Ebola outbreak threaten to become an (inter)national epidemic?

August 22, 2012

(This article was first published on Pirate Science » R, and kindly contributed to R-bloggers)

Uganda Roads

Map of the Uganda road network, created using the R programming language

We want to evaluate the seriousness of the threat posed by the recent ebola outbreak in western Uganda. The outbreak appeared in Kigadi, a small village in the Kibaale district. The disease was first confirmed by the government on 28 July. By 11 Aug, Medecins Sans Frontieres epidemiologist Dr Paul Roddy said the disease was under control, with no new deaths in August. It will be classified as contained if there are no confirmed cases by middle September. In total, 19 people died from the disease in the outbreak.

The disease spreads between people by contact with contaminated body fluids. Transmission, then, is slow (in comparison to disease with aerosol transmission, i.e. influenza). We reasoned that if the disease was to spread to other communities, the most likely route would be along roadways.

We obtained a shapefile describing the Uganda road network from Humanitarian Response. We plot it as follows:

### use the maptools library

## load the data:
ugnat <- readShapePoly('Uganda_national2006')
ugroads <- readShapeLines('Uganda_Roads_Feb2009')
ugtowns <- readShapePoints('Uganda_Towns')
ugvil <- readShapePoints('Uganda_villages_27Jan09')

## plot it
plot(ugroads[ugroads$RDLNTYPETX==”Unpaved Trails/Footpaths”,],add=TRUE,lwd=1,col=’lightgray’)
plot(ugroads[ugroads$RDLNTYPETX==”Tracks trails or footpaths”,],add=TRUE,lwd=1,col=’lightgray’)
plot(ugroads[ugroads$RDLNTYPETX==”Secondary road”,],add=TRUE,lwd=2,col=’burlywood3′)
plot(ugroads[ugroads$RDLNTYPETX==”Primary and secondary roads”,],add=TRUE,lwd=3,col=’burlywood3′)
kagadi <- grep('Kagadi',ugvil$FULL_NAME,ignore.case=TRUE)

Converting it to a graph requires matching endpoints of the roads. Simple enough, except that the road coordinates are buried three classes deep in the data structure. We write two utility functions:

gthead <- function(indx){
return([email protected][indx][[1]]@Lines[[1]]@coords[1,])}

gttail <- function(indx){
return(tail([email protected][indx][[1]]@Lines[[1]]@coords,n=1))}

mkhash <- function(coord){

Then, to make the graph

nroads <- dim(ugroads)[1]
edges <- matrix('',nrow=nroads,ncol=2)

for(i in 1:nroads){
edges[i,1] <- mkhash(gthead(ugroads,i))
edges[i,2] <- mkhash(gttail(ugroads,i))

gr <- graph.edgelist(edges,directed=FALSE)

where the hash function pastes together the x and y coordinates of an endpoint. The resulting graph has 2011 nodes and 1992 edges. The maximum degree node has degree 7 (if one allows a maximum of one edge between any two nodes). Almost half of the nodes have degree one — they are terminal. Analysis of the graph shows that none of the nodes have strong spreading power, whether measured by expected reach, path counting, degree, or k-shell.

The model has obvious limitations. Nodes are road junctures, not population centers. No allowance is made for road length or size. our conclusion should be taken with a grain of salt.

Conclusion: The disease is a local tragedy, but is unlikely to become a national one.

To leave a comment for the author, please follow the link and comment on their blog: Pirate Science » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training




CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)