Kulldorff's Spatial Scan Statistic

2714
6
Jump to solution
07-25-2012 09:56 AM
AvishekDutta
New Contributor
Hello,

I have a semester project to develop a tool using Python which implements Kulldorff's algorithm and finds clusters in point data.

Currently it is a mess: I understand Kuldorff's algorithm upto the part before it dives into Bernoulli & Poisson. I imagine I have to call certain things from R. I have several disease & crime point shape files.

I am not able to start with the coding due insufficient understanding of all these aspects.

What are the reqiurements of the data, I mean what all attributes the points must have(population, time etc)?

How do I program a (Bernoulli/Poisson) statistical test (I have never done this, I dont have the sligtest clue)?

How to integrate python and R? Rpy2 is preferrable, I guess. But need help installing rpy2.

These are for starters. Indeed I am not being able to set my concept right and start work.

Please help me.

Avishek
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JeffreyEvans
Occasional Contributor III
The binomial likelihood and Bernoulli model are the same. For more information on the Bernoulli model see: http://www.u.arizona.edu/~hirano/696_2008/ln5.pdf

As for implementation I would write an R script with parameters that are passed from Python. ESRI has an example calling a clustering script: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=F855D6D1-1422-2418-A0B2-643E6...

I also stumbled across a very intriguing method for interfacing R and ArcGIS through Python that I have not tried yet. I attached the PDF.

View solution in original post

0 Kudos
6 Replies
PhilMorefield
Occasional Contributor III
I doubt you will find a answer to your problem here. This is not an algorithm implemented in ArcGIS and requires some fairly complex statistics.

The first piece of advice I can give you is to forget rpy or rpy2. They haven't been supported on Windows for quite some time. Unless you are using a Unix/Linux operating system, you will be heading down a long and disappointing road. You can probably find the statistical functions and distributions you need in scipy. Or you could certainly do everything using only R. You don't even need ArcGIS for this, except to make pretty maps.

Have you seen this yet?
0 Kudos
JeffreyEvans
Occasional Contributor III
No need to reinvent the wheel. The SatScan statistic is available in the "SpatialEpi" R package with the "kulldorff" function. To create an ArcTool I would write a Python wrapper for the R function.

http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=SpatialEpi:kulldorff
0 Kudos
AvishekDutta
New Contributor
No need to reinvent the wheel. The SatScan statistic is available in the "SpatialEpi" R package with the "kulldorff" function. To create an ArcTool I would write a Python wrapper for the R function.

http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=SpatialEpi:kulldorff


Yes, regarding this one by "binomial likelihood" do they mean the Bernoulli model?

And to call this one should I use Rpy2. Like Phil said my journey down the disappointing road has already started, Rpy2 is giving cause for great agony.
0 Kudos
JeffreyEvans
Occasional Contributor III
The binomial likelihood and Bernoulli model are the same. For more information on the Bernoulli model see: http://www.u.arizona.edu/~hirano/696_2008/ln5.pdf

As for implementation I would write an R script with parameters that are passed from Python. ESRI has an example calling a clustering script: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=F855D6D1-1422-2418-A0B2-643E6...

I also stumbled across a very intriguing method for interfacing R and ArcGIS through Python that I have not tried yet. I attached the PDF.
0 Kudos
PhilMorefield
Occasional Contributor III
The first piece of advice I can give you is to forget rpy or rpy2. They haven't been supported on Windows for quite some time. Unless you are using a Unix/Linux operating system, you will be heading down a long and disappointing road.

Of course, as soon as I say this someone builds a Windows installer for rpy2...

As for implementation I would write an R script with parameters that are passed from Python. ESRI has an example calling a clustering script: http://resources.arcgis.com/gallery/...2-643E624A8925

I also stumbled across a very intriguing method for interfacing R and ArcGIS through Python that I have not tried yet. I attached the PDF.

The PDF you attached is interesting; I hadn't seen that before. Both methods seem a bit klugey, in my opinion. But they are well documented, so those are definitely options. I guess it all depends what the purpose of the project is. Calling an existing R function is very different from programming the algorithm yourself!

Fortunately, a true integration of R into ArcGIS is "under consideration" by ESRI.

Fingers crossed.
0 Kudos
AvishekDutta
New Contributor
Of course, as soon as I say this someone builds a Windows installer for rpy2...



Yes I found this too but there are still problems. Arcgis support python 2.6.5. This is clearly shown in IDLE. This binary installer works with python 2.7.  I installed python 2.7 but couldnot find a way to make arcgis 10 point to python 2.7. So I am currently mailing to the rpy2 list to find out if I can use it.

The documentation at http://rgm2.lab.nig.ac.jp/RGM2/func....lEpi:kulldorff
is very nice. But can anyone help with the basics of the input data of this function. A rather deeper technical explanation of the parameters of the function would be nice. I mean how to correspond mathamatics which I read here

http://books.google.de/books?id=gySuCmuUEFkC&pg=PA145&lpg=PA145&dq=kulldorff+%2B+point+pattern+analy...

and this functions parameters.

Regards,
Avishek
0 Kudos