Carrying out Logistic Regression in ArcGis

3743
5
08-21-2016 04:28 AM
HenryCann
New Contributor

Hi all,

Firstly just wanted to acknowledge that I have seen this post here https://community.esri.com/thread/41562 

which provides some clues regarding how to do this - however my knowledge does not appear to be sufficient for me to follow.

Basically I understand that you can utilise R packages to carry out logistic regression in R. I have already carried out my own logistic regression in R but would prefer to do this in arcmap for the mapping capabilities.

I also understand that you need to import a script written for R into arcmap. I've seen references to creating a custom toolbox?

However I'm not sure how to proceed; could somebody break this down into steps for me? I am new to working with scripts.

Many thanks in advance,

Henry

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

The bridge tools do exist ... without the interface... since the Scipy stack is now available in PRO What is conda?—ArcPy Get Started | ArcGIS for Desktop but there are no readily available tools. Also, the full Scipy related functionality isn't installed.  I am not sure if scikit learn is part of the distribution which is what you would want for regression ( 1.1. Generalized Linear Models — scikit-learn 0.17.1 documentation )  You might be advised to get outputs into a mappable form supported by ArcGIS rather than trying do the analysis within arc* since you will be effectively be relying on the sci* invocations.

Should you have, or are moving to ArcGIS PRO, this is a link to my initial documentations about the new access to more advanced funtionality including numpy, scipy and the like

/blogs/dan_patterson/2016/07/17/anaconda-spyder-and-arcgis-pro 

HenryCann
New Contributor

Hi Dan, thank you for this. I do have ArcPRO installed on my laptop, it's just I haven't used it and have no idea how really to work with it. If it's fairly intuitive and similar to basic arcmap I could give it a go.

Your point around getting data into a format mappable by R is a good one potentially. As I say, I have a logistic output from R already. I also need to run a GWR - could then import output into Arc. But boom line...you recommend PRO for this?

0 Kudos
DanPatterson_Retired
MVP Emeritus

everything supports ASCII and tiff for raster formats Raster file formats—ArcGIS Pro | ArcGIS for Desktop and the shapfile for vector and gdal (or rgdal?) support others.  Just export your data, an bring it in to PRO... with the cavaet that you have the Spatial Analyst extension

HenryCann
New Contributor

What format do you advise exporting the data in so that it can be read? 

In arcMap I have already merged a shapefile with data and its currently read in as a shapefile - can I export this straight to Pro? Thing confusing me is Pro doesn't seem to let me start by 'Adding Data' - I have to add some sort of map because the other options are greyed out currently.

0 Kudos
DanPatterson_Retired
MVP Emeritus

start with a map... then add data, for vector 3rd party, a shapefile is a pretty standard option, for raster tif might be easier