Wednesday, September 19, 2012

An OLS experience. Analysis takes time to learn.

Ahhhhhh.  At least one can learn. Learning is the salt of the earth. Failing to make an effort to learn puts one stuck in the mud.    I may not know all there is to learn about OLS regression analysis, but I've tried my heart out trying.   The last post gave you a hint of the process, here is the final result with my report and data for viewing.   Our data had 29 variables, I ended up with 11.  A full run of all variables gave me a multiple r squared - -53.61/ an adjusted r squared of -111.60, with an AIC of 629. These are initially horrible numbers.   However with a little fines and some nashing of teeth, grunting and starting from mid-scratch- the final run with 11 variables, ended up with a multiple r squared of 0.53 and an adjusted r squared of 0.39, with the AIC at 225.  These numbers may sound jumbily to someone else but to a newbie on this process it sweet music.

Our goal was to come up with viable population census data which may propose probable locations (being census tracts not actual addresses) where meth labs could turn up.    My final analysis could have gone a little further, but time ran out (it usually does for these labs).   The analyzing lawyer part of me wanted to explain everything, but remembering to "stick to the facts" only what we had without supposing was a task for me in itself.


I've only included my results, analysis chart and final map for review here.  












RESULTS:
The overall objective was to use 29 census population variables to predict probable locations for meth labs in Kanawha and Putnam Counties, West Virginia.  After over 40 OLS runs had been conducted with 29 initial variables covering 54 observations, eleven variables and 49 observations survived the elimination process.  OLS run b21 has been selected as the most representative to use for the results analysis although more could have been conducted  time limitations overruled. 

Seven out of eleven variables had negative coefficients with the maximum being the average family size at -8.029133 and the minimum of -0.007652 being the percentage of females with children (pcnt_fchld).  The remaining negative coefficients ranged from -0.074732 to -0.597828.  

When reviewing the probabilities, several groupings evolved. The 50-64 age stood out as a significant statistical value at 0.02351. Three categories made up the mid-low range between 0.071 to 0.082. The mid-range fell from  0.142 to 0.413. While the high group were at 0.964 and 0.792 respectively.    Two categories showed significant in the robust probabilities being pcnt50_64 at 0.0091 and pcnt18-21 at 0.0016.  Only two fields pcnt18_21 and pcnt50_64 were indicative by "*" as being statistically significant.  

Although there is no chart available to show the variance inflation factor (VIF) for the eleven categories it ranged from 1.35 to 3.45 with the mean at 2.35 well below the coveted >7.5 redundancy threshold.  However, the overall diagnostic for the OLS showed a Jarque-Bera statistic reflecting significant bias, even though the AIC (Akaike Information Criterion) continued to drop from the initial 629 to 225 for overall model performance. 

DISCUSSION:

Although this small evaluation of population characteristics for Kanawha and Putnam had two suggestive statistically significant categories, it is not conclusive nor complete.  It is loosely based upon a comparative study "Methamphetamine Laboratories: The Geography of Drug Production" (Weishelt, R.A., Wells, L.E, 2010), which used the CDC Social Ecological Model as its basis for analysis. It had 63 base variables casting a greater lifestyle –social profile than the subject analysis.  Our small analysis primarily using population data omitting many influential variables such as poverty levels, unemployment, civic/religious membership and employment categories.  The subject study had significant bias, indicating additional variables may need to be added and others with high probabilities such as pcnt_mchld and pcnt30_39 may need to be removed.  

Both studies revealed there are areas which have no meth labs at all.  Our small study contained 4 census zones without labs, being 0.07 percent of the total.  These zones were eventually removed from the subject study calculations which affected bias.  Future investigation would be helpful to reveal the population and social make up of these "zero meth lab" zones as well.  
   
In Summary, 93 percent of our study area had meth lab influences.  Although the population percentages for the age groups 50-64 and 18-21 were indicated as significantly influential there remains additional information to be collected.  What can be said is that the presence of meth labs either from its environmental "trash" or social influence affects a greater population overall than one may realize. Additional data and studies will need to be conducted to truly grasp its reach upon our overall culture.

Saturday, September 15, 2012

OLS- It's nearly like OCD- in application

OLS- Ordinary Least Squares- It's not much on the surface but it's a great regression method of comparing the relationship between two variables.    It really takes someone nearly OCD, Over the top/ not Confused but nearly Deranged to accomplish it.   Starting with 29 US Census (2010) variables we deducted them one at a time to increase the r-squared values.   Figuring out the process was part of the battle.  There is no clear cut method. One can use python to do the reiterations but you still need to do the input for inductive reasoning to occur.  

Setting up an evaluation table would be a good thing.  I just used a hand table eliminating first those variables which had the closest zero coefficient, then probability and weighted the VIF on whether I wanted to remove it or not.   Still struggling in getting the results to copy/paste into excel but did use the copy/paste of print screen to a word doc then printed out for visual comparison. This method was a little bulky but got the job done. 

Here's a table for the revised run of A13 which I is the final result after the elimination of outlier census tracts.


Considering I had such frustration with understanding the general concept, which made me late on the assignment, only 21 OLS runs were made which was many less than others.    The original OLS run of all 29 were: Multiple r-squared  -53.61/Adjusted r-squared -119.60.   The final revised census layer without the most offensive outliers resulted in a OLS run : Multiple r-squared 0.65/Adjusted r-squared 0.47 (reflected in the table above)   I'm fairly pleased.   A map of the run shows below.     Additional studies including presence of roads, cities, schools, colleges, etc. were not part of this assignment although in a real case review may very well be major considerations of influence on the numbers.


Wednesday, September 12, 2012

Picking out the parts of a Picture

It will be said more than once this semester with the Remote Sensing class and especially by me. A picture is worth more than a 1000 words.   Pictures have more parts than just the features they intend to depict.   This class will be an interesting one learning about pictures made from above.

Our first assignment is to identify features.  Here are the first two exercises.  The maps title tells all.



Sunday, September 9, 2012

Numbers- Statistical Information, Collecting, Preparing

Welcome to the beginning of the last Semester.   Our Special Topics class will have three parts to each lesson.   The first Topic is Statistical information.  Meth Labs.  Where, why, when?   Is there information out there to guide us.      Our 3 week study will be on Charleston, WV.  Preparing our base map which follows and collecting the information from the US Census 2010/2000.  We are adding categories to the Census data for calculation based on a proven social ecological model for regression analysis used by the CDC.    We'll see how this turns out later. 

Nothing fancy this week, just a base to get started.  Hope to add more to it next week.
Processes & thoughts follow:



1-Moved data from r to s.  Set up basic map properties and set geodata base to: Project1Data.gdb.
2-Saved map as Stat_Base.
3-Recorded list of fields in Census layer for creation of new fields using Idle (python script). Added new lines to python script created by UWF online staff as needed to create new fields with percentage values for statistical model.  New fields are: Roommates, pcntPopGro,  pcntWhite,  pcntRmmate,  pcnt_1M,  pcnt_1F,  pcnt_MFCLD, pcnt_MF,  pcnt_FCHLD,  pcnt_MCHLD, M_F_Ratio, pcntVacant, pcntRental, pcntUnder5,  pcnt5_17,  pcnt18_21,  pcnt22_29, pcnt30_39,  pcnt40_49, pcnt50_64,  pcnt65_UP,  pcntUnEdu. (yea it worked).
4- Performed spatial join with census and meth lab layers, output: Centrt_MethLab_Spatialjoin. Added new field for LabDensity (join/sqmi).
5- Added new dataframe with West Virginia as single layer from Week4 cartography, America's Administration map as inset (GCS wgs1984 to current projection on census tracts).

End for now.  Part 2 will be the Analysis section. 


Tuesday, September 4, 2012

Searching for Trout_GIS Applications- FINAL Project-

Our goal for the final project was to create a location scenero applying weighted criteria techniques to determine optimum sites for the project.   The following is the search for a year round trout stream community center in Fannin County, Georgia.  This post is the powerpoint presentation in slide format.  Methods and analysis follow along with my references less the slides which are included in the presentation to prevent redundancy.  



 







Methods & Analysis:



Methods:

Study Site:

              Fannin County lies on the Georgia-Tennessee line.  The largest water body is Blue Ridge Lake created in the 1930's now operated by the Tennessee Valley Authority.  Out of 391.43 square miles only 5.69 square miles are water bodies.  Although Fannin County is not large in size nor high in population, it has 10.24 percent out of the  5,437 miles of designated trout streams within the 25 county trout stream region.  More than 63 percent of the designated trout streams are under private ownership. ( DeMeo,T.A, Christy, D.R & Kundell, J.E. 2005).

              The northwestern area of Fannin County east of McCaysville has a large catch basin with year round permitted trout fishing.  This catch basin (Fightingtown Creek) flows north into the Tennessee River basin and will be our initial target area unless the data leads us to other viable regions in the county.    


Data Requirements/Sources:

·        Trout Streams in Fannin County, GA   (site: wildtroutstreams.com has GIS data) depicted below in green was used as base information and location.  Specifically the corridor on northwest side which  has year-round trout fishing was the targeted zone (corridor of Hwy 207, 127, 2, 210, 159, 212. Primarily the catch basin of Fightingtown creek).   See area below:


·       Most of the general data was obtained through the USGS (U.S. Geological Survey)website, linked through to state specific data, ours being the Georgia Spatial Data Technology.  http://csat.er.usgs.gov/statewide/downloads.html  Unfortunately, on August 1, 2012 the links to the state specific data was disabled due to lack of funding.   There was additional data this GIS Analyst expected to obtain namely the DOQQ series for Fannin County, Georgia  and other data clarified before the final product was to be turned in. This did not occur. Alternative forms of aerials was obtained.

Most of the USGS data was converted from Clark 1866 to NAD 1983, some was originally NAD 1927 which was also converted to NAD 1983.

·       The final projection and project projection chosen was  Albers Equal Conical Area, Datum: D North American 1983. Most of the USGS data and the individual Georgia data from the Georgia GIS Clearinghouse and geocommunity.com were also in North Americas Albers Equal Conic.

·       As the data was evaluated it divided into two groups, those scaled very large based on the US Atlas series and those based on an individual state scale.  A list of the data is below:

              GNIS for State of Georgia, 1997, point of accuracy 40 meters.
              Counties of Georgia, from US Census/TIGER-, 1996  The project will use the Fannin County, GA
                                           extent as its basis for all clips & raster extraction, accuracy 40 meters
               
              USGS, topo maps in digital raster, from 1975, accuracy 40 meters
              USGS-Georgia Cities & Towns, from US Census/TIGER, 1995, accuracy 40 meters
              USGS-Georgia Elevation, DEM, at 250, 1987, 3x3=1 degree,
              USGS- Georgia Slope, 1987, scale 1:100,000
              Georgia Soil Survey, 1994, accuracy 1230 meters, scale 1:250,000
Conservation lands, reference Georgia GAP Project, 1999, accurate as 1:12000, public owned lands w/o natural areas not included, not inclusive of all historic sites.
Georgia- Landuse 1 & Landuse2, Land use from 1972-1975, accuracy between 10-40 acres, scale 1:250,000
USGS, Georgia State park & Historical Sites, updated 12/1998, accuracy to 40 meters.
USGS, River Basin Management Planning, file 06020003, Tennessee River Basin,  NAD 1983.
Trout stream information from wildtroutsteams.com,  georigiaoutdoors.com, and georgiawildlife.com.
             
Analysis: 

              This project was accomplished using GIS analysis based on specific criteria to locate potential Sites for the community center.  Specifically, conditional raster analysis through the spatial analyst extension in ArcGIS Map Version 10, was used.  Conditional raster analysis  evaluates each raster cell assigning it a true or false value based upon an established  query.   In our case the DEM (elevation) layer was queried for Elevation 674 or less and with a second value of 675 to 800.  With the Slope raster, it was divided into Slope less than 6 percent and slope from 6.1 percent to 8 percent.  Alternatives were given at the time of evaluation to allow for alternative sites if the original values did not produce results.  The evaluation was conducted using a model form.   An issue arose when the original selected clipping layer (Fannin Co) was a different scale from the originating rasters in the conditional raster argument. After a new clipping layer was found, the conditional raster model was rerun without difficulty. 


Once the Elevation and Slope rasters were converted to shapefiles the second evaluation portion could be initiated.  A Fannin County base map was established using North America Albers Equal Conic as the projected coordinate system for the model.      For each map, map properties were established, environments were set using the original State of Georgia DEM 250 as the extent and coordinate system.  
              A State of Georgia base test map was established to view data.  Fannin Co, isolated for the raster model was used to clip several layers:  hydro, forest, GNIS, roads, etc.   After the base layers of Fannin County were established, evaluation began.  Elevation and slope intersects were placed on the base map, then streams. As the results began to appear county wide, potential areas for sites were coming into view.   These evaluations were created and outputs made:

Elevation/Slope:   (Results Map )
              1- Intersect between Elevation 675-800 with Slope under 6
              2- Intersect between Elevation 675-800 with Slope 6-8 (as an alternative was not needed)
             
 Year Round Streams: (Incorporated as layer file in Maps):
            3. New feature class for year round streams was created, digitized using the paper  Fannin       County Trout Streams by Georgia WildLife.com as a guide with the hydrology layer.
              4. Streams in Year round layer were buffered to 300 feet.



              Private Lands:   (Results Map)
              5. Forest layer added showing Federal and private lands,  private lands isolated.
              6. Buffered year round streams and output of Elevation/Slope6 were intersected.
              7. Private lands intersected with output of Elevation/Slope6/Buffered.

An overview of Fannin County with the addressed roads showed the absence of county roads in the western region which is primarily federal conservation land.  It was this revelation which added an additional criteria to separate out privately owned land which was listed as a field in an attribute table.  


Once criteria sites were identified, these visuals were printed out, then using shape points, the GIS Analyst was able to locate common points using georeferencing techniques.  A common point was either a static point on the boundary line of the federal lands or a point on the streams.  Geographic coordinates were available on  qpublic.net the official tax property parcel website for Fannin County, Georgia.   Using a combination of matching points and Google aerial maps, sites were  absolutely located  to physical locations on the official Fannin County property map.    Although the site parcel  polygons did not match any property parcels exactly,  the GIS analyst was able to coordinate the sites to common tax property parcels containing portions of the desired site location.   This was quite fortunate due to an unexpected difficulty in obtaining orthiomagery for the site parcels. Funding  cuts with USGS  occurred on August 1, 2012 which affected the retrieval of orthoimagery, additional web sites where affected as well.  Notwithstanding the unexpected, Google Earth, enabled retrieval of aerial images.     For each of the sites, A, B and C, a series of evaluations were made to satisfy Objectives Two and Three. 



The last step in the analysis process was to apply a weighted analysis to several of the criteria.

1. The school, church, community layer was converted into a raster, then reclassed. However, the reclassing did not result in the attributes being ranged from near to far, but randomly spread out.  This does not work for our purposes.   Since there have been numerous issues with preparing this feature to raster etc. the weighed analysis has not been successful.
2. The roads layer was also converted into a raster, then reclassed. Checking the attribute table the roads are classed from near to far, which works properly.
3. Euclidean Distance was performed on each Site point, A, B & C. Each point was reclassed as an individual raster.
4. A model was set up for the weighted analysis.  For each run of the model the school and roads input remained the same.  Each point was entered as a parameter and the output was renamed accordingly. After review, the results were void, see description of school layer above.

5.  In light of the model issues, a weighted chart was created.  Several criteria in Objective 2 & 3 had to be evaluated using visual analysis.  A weighted chart was created for this. Same Chart as in conclusion Above.


Conclusion:

Using the criteria set out by the client, three viable sites were found in the target area using GIS Analysis over and above the usual search conducted by real estate agents.   Each possible site was located on the ground using georeferencing techniques through the use of Google Earth and the Fannin County Tax Assessor's web portal, qpublic.net. 

A weighted analysis was used through visual inspection of the properties centering on Objectives two and three which required special application of the criteria.   Applying the weighted analysis revealed potential issues with the sites before actual trips to the physical locations were planned, saving both time and money.