Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

First was getting the data, and importing it from the SPSS file.
(see notes on that at the bottom of this page).

Then there was figuring out how to group the religions so that they
were grouped the same way the original map was done (without knowing
exactly how they did the groupings in the original map).  There are
over 600 different religions tracked in the data file, each religion
in a separate variable.

Then I had to transpose the data, so that the variables became values,
so I could do a query and get the 'max' value in each county.

SAS/Graph Gmap assigns the pattern colors alphabetically to the data,
so I had to figure out which pattern'n' mapped to which color/religion.
Then, to get the 'Other' colorchip to show up last in the legend,
I had to hardcode the order in the legend statement.

Next, for the religions which have >=50% of the county population,
I annotated a black dot in the middle of that county (I used the 
%centroid() macro to calculate the approx center locations).

And I annotated the state outlines onto the county map, using 
'proc gremove' to get the state outline coordinates, and then 
convert those coordinates into annotate poly/polycont outlines.

Then, to add extra functionality the original map didn't have,
I'm adding html charttips to each county, so you can mouse over
and see the county name & predominant religion.

---------------------------------------------------------------

Here's the location where I found the original map:
http://strangemaps.wordpress.com/2008/01/27/237-regionalism-and-religiosity/


For examples of other maps:
http://www.glenmary.org/grc/Maps_2007/menu.htm

-----

Here's the data download page:
http://www.thearda.com/Archive/ChCounty.asp
Select the year 2000 data.
Go to the 'Download' tab.
Select 'Continue'.
Downloaded & run the self-extracting binary for the SPSS 'portable' file.
ARD472SP.EXE

That created an spss RCMSCY.POR (portable spss) file.
Which I then read into a sas dataset using the spss libname engine.

libname spslib spss 'RCMSCY.POR';
proc contents data=spslib._first_;
run;
proc sql;
create table mydata as select * from spslib._first_;
quit; run;

And, here are some "rules" for using this data (from the website above)...

"When using ARDA data in publications and presentations, the author should 
acknowledge the Association of Religion Data Archives and the original 
collector(s) of the data (e.g., The data were downloaded from the 
Association of Religion Data Archives, www.TheARDA.com ...) "

-----

And, for posterity, here's how I grouped the variables, to come up with the 
color/groups ...

 sum(ABAPRT, AMBAPRT, BAPGCRT, BAPMIRT, CONBART, DUCKRRT, ENTBPRT, FRWBPRT, GSIXBRT, INFRBRT, INTFBRT,
     JSPBPRT, LNDBPRT, NAMBPRT, NHBAPRT, NPBAPRT, OLDMBRT, ORFWBRT, PRIBCRT, PRIBERT, PROPBRT, 
     RGBAPRT, SBCRT, SEPBPRT, STRBPRT, SWBPFRT, TWOSDRT, WYNMBRT) as Baptist,
/*
ABAPRT   American Baptist Churches in the USA--Rates of adherence per 1000 population (2000)                    
AMBAPRT  American Baptist Association--Rates of adherence per 1000 population (2000)                            
BAPGCRT  Baptist General Conference--Rates of adherence per 1000 population (2000)                              
BAPMIRT  Baptist Missionary Association of America--Rates of adherence per 1000 population (2000)               
CONBART  Conservative Baptist Association of America--Rates of adherence per 1000 population (2000)             
DUCKRRT  Duck River and Kindred Baptists Associations--Rate of populations per 1000 population (2000)           
ENTBPRT  Enterprise Baptists Association--Rates of adherence per 1000 population (2000)                         
FRWBPRT  National Association of Free Will Baptists--Rates of adherence per 1000 population (2000)              
GSIXBRT  General Six Principle Baptists—Rates of adherence per 1000 population (2000)                           
INFRBRT  Independent Free Will Baptists Associations--Rates of adherence per 1000 population (2000)             
INTFBRT  Interstate and Foreign Landmark Missionary Baptist Association--Rates of adherence per 1000 population (2000)    
JSPBPRT  Jasper Baptist and Pleasant Valley Baptist Association--Rates of adherence per 1000 population (2000)  
LNDBPRT  Landmark Missionary Baptist, Independent Associations and Unaffiliated Churches--Rates of adherence per 1000 population  
NAMBPRT  North American Baptist Conference--Rates of adherence per 1000 population (2000)                       
NHBAPRT  New Hope Baptist Association--Rates of adherence per 1000 population (2000)                            
NPBAPRT  National Primitive Baptist Convention, USA--Rates of adherence per 1000 population (2000)              
OLDMBRT  Old Missionary Baptists Associations--Rates of adherence per 1000 population (2000)                    
ORFWBRT  Original Free Will Baptists--Rates of adherence per 1000 population (2000)                             
PRIBCRT  Primitive Baptist Church, The--Rates of adherence per 1000 population (2000)                           
PRIBERT  Primitive Baptist, East District Association of--Rates of adherence per 1000 population (2000)         
PROPBRT  Progressive Primitive Baptists--Rates of adherence per 1000 population (2000)                          
RGBAPRT  General Association of Regular Baptist Churches--Rates of adherence per 1000 population (2000)         
SBCRT    Southern Baptist Convention--Rates of adherence per 1000 population (2000)                             
SEPBPRT  Separate Baptists in Christ--Rates of adherence per 1000 population (2000)                             
STRBPRT  Strict Baptists--Rates of adherence per 1000 population (2000)                                         
SWBPFRT  Southwide Baptist Fellowship--Rates of adherence per 1000 population (2000)                            
TWOSDRT  Two-Seed-in-the-Spirit Predestinarian Baptists--Rates of adherence per 1000 population (2000)          
WYNMBRT  Wayne Trail Missionary Baptist Association--Rates of adherence per 1000 population (2000)              
*/

 CATHRT as Catholic,
/*
 sum(ARMCIRT, ARMCIRT, ARMETRT, CATHRT) as Catholic,
CATHRT   Catholic Church--Rates of adherence per 1000 population (2000)                                         
*/

 sum(CHSCHRT, COMCHRT, ANTAMRT, APAMRT, APNAZRT, CCCADRT, CHRCHRT, CHRDIRT, CHRMIRT, CHRUNRT, CONCCRT, MXCCFRT, NACCCRT) as Christian,
/*
Church of Christ = autonomous Christian
CHSCHRT  Churches of Christ--Rates of adherence per 1000 population (2000)                                      
COMCHRT  Community Church of Christ--Rates of adherence per 1000 population (2000)  
APAMRT   Apostolic Christian Church of America, Inc.--Rates of adherence per 1000 population (2000)             
APNAZRT  Apostolic Christian Churches (Nazarean)--Rates of adherence per 1000 population (2000)                 
CCCADRT  Congregational Christian Churches, Additional (Not in any CCC Body)--Rates of adherence per 1000 population (2000)   
CHRCHRT  Christian Churches and Churches of Christ--Rates of adherence per 1000 population (2000)               
CHRDIRT  Christian Church (Disciples of Christ)--Rates of adherence per 1000 population (2000)                  
CHRMIRT  Christian and Missionary Alliance--Rates of adherence per 1000 population (2000)                       
CHRUNRT  Christian Union--Rates of adherence per 1000 population (2000)                                         
CONCCRT  Conservative Congregational Christian Conference--Rates of adherence per 1000 population (2000)        
MXCCFRT  Midwest Congregational Christian Fellowship--Rates of adherence per 1000 population (2000)             
NACCCRT  National Association of Congregational Christian Churches--Rates of adherence per 1000 population (2000)  
*/

 UCCRT as United_Christ,
/*
I would have thought to have grouped this with Christian/Church of Christ, but 
in the map I'm copying, this one is 'gray' and separate from the yellow counties.
UCCRT    United Church of Christ--Rates of adherence per 1000 population (2000)
*/

 LDSRT as Latter,
/*
LDSRT    Church of Jesus Christ of Latter-day Saints--Rates of adherence per 1000 population (2000)
*/

 sum(ELCART, FRLUTRT, LTHMSRT, WELSRT) as Lutheran,
/*
ELCART   Evangelical Lutheran Church in America--Rates of adherence per 1000 population (2000)                  
FRLUTRT  Association of Free Lutheran Congregations-Rates of adherence per 1000 population (2000)               
LTHMSRT  Lutheran Church--Missouri Synod--Rates of adherence per 1000 population (2000)                         
WELSRT   Wisconsin Evangelical Lutheran Synod--Rates of adherence per 1000 population (2000)                    
*/

 sum(BEACHRT, CHGCMRT, CONMCRT, EPMENRT, EVMENRT, MENOTRT, MENUSRT, MNBRURT, OLDOMRT, RFMENRT, AMOTHRT, OLDOART) as Mennonite,
/*
BEACHRT  Beachy Amish Mennonite Churches--Rates of adherence per 1000 population (2000)                         
CHGCMRT  Church of God in Christ, Mennonite--Rates of adherence per 1000 population (2000)                      
CONMCRT  Conservative Mennonite Conference--Rates of adherence per 1000 population (2000)                       
EPMENRT  Eastern Pennsylvanian Mennonite Church--Rates of adherence per 1000 population (2000)                  
EVMENRT  Evangelical Mennonite Church--Rates of adherence per 1000 population (2000)                            
MENOTRT  Mennonite; Other Groups--Rates of adherence per 1000 population (2000)                                 
MENUSRT  Mennonite Church USA--Rates of adherence per 1000 population (2000)                                    
MNBRURT  Mennonite Brethren Churches, U.S. Conference of--Rates of adherence per 1000 population (2000)         
OLDOMRT  Old Order Mennonite--Rates of adherence per 1000 population (2000)                                     
RFMENRT  Reformed Mennonite Church--Rates of adherence per 1000 population (2000)                               
AMOTHRT  Amish; Other Groups--Rates of adherence per 1000 population (2000)                                     
OLDOART  Old Order Amish--Rates of adherence per 1000 population (2000)                                         
*/

 sum(AWMCRT, FNDMTRT, FRMTHRT, PRIMTRT, UMETHRT, WESLYRT) as Methodist,
/*
AWMCRT   Allegheny Wesleyan Methodist Connection--Rates of adherence per 1000 population (2000)                 
FNDMTRT  Fundamental Methodist Conference, Inc.--Rates of adherence per 1000 population (2000)                  
FRMTHRT  Free Methodist Church of North America--Rates of adherence per 1000 population (2000)                  
PRIMTRT  Primitive Methodist Church in the USA--Rates of adherence per 1000 population (2000)                   
UMETHRT  United Methodist Church--Rates of adherence per 1000 population (2000)                                 
WESLYRT  Wesleyan Church, The--Rates of adherence per 1000 population (2000)                                    
*/

 sum( NTHRFRT, PREFCRT,  RFCHART, RFCHURT, URFCHRT, CHRRFRT, RFBAPRT) as Reformed,
/*
NTHRFRT  Netherlands Reformed Congregations--Rates of adherence per 1000 population (2000)                      
PREFCRT  Protestant Reformed Churches in America--Rates of adherence per 1000 population (2000)                 
RFCHART  Reformed Church in America--Rates of adherence per 1000 population (2000)                              
RFCHURT  Reformed Church in the United States--Rates of adherence per 1000 population (2000)                    
URFCHRT  United Reformed Churches in North America--Rates of adherence per 1000 population (2000)               
CHRRFRT  Christian Reformed Church in North America--Rates of adherence per 1000 population (2000)              
RFBAPRT  Reformed Baptist Churches--Rates of adherence per 1000 population (2000)                               
*/

 SEVADRT as Adventist,
/*
SEVADRT  Seventh-Day Adventist Church--Rates of adherence per 1000 population (2000)                            
*/

 sum(BRETCRT, BRETORT, CHBRERT, HUTTBRT, OLDRBRT) as Brethren,
/*
BRETCRT  Brethren in Christ Church--Rates of adherence per 1000 population (2000)                               
BRETORT  Brethren Church, The (Ashland, Ohio)--Rates of adherence per 1000 population (2000)                    
CHBRERT  Church of the Brethren--Rates of adherence per 1000 population (2000)                                  
HUTTBRT  Hutterian Brethren--Rates of adherence per 1000 population (2000)                                      
OLDRBRT  Old Order River Brethren--Rates of adherence per 1000 population (2000)                                
*/

 QUAKERT as Friends,
/*
QUAKERT  Friends (Quakers)--Rates of adherence per 1000 population (2000)
*/

 sum(ALORART, ALORTRT, BULORRT, COPORRT, GRORART, GRORVRT, HLYORRT, MACORRT, MLKADRT, MLKSYRT, MLKSYRT, OCABDRT, 
     OCATDRT, ORPRSRT, ORTHRT, RMOACRT, RMOEART, ROORRT, ROUSART, SRBGMRT, SRBUSRT, SYRANRT, UKORTRT, EAORRT, ANTAMRT) as Orthodox, 
/*
ALORART  Albanian Orthodox Diocese of America-Rates of adherence per 1000 population (2000)                     
ALORTRT  Orthodox Church in America: Albanian Orthodox Archdiocese--Rates of adherence per 1000 population (2000)   
BULORRT  Bulgarian Orthodox Diocese of the USA--Rates of adherence per 1000 population (2000)                   
COPORRT  Coptic Orthodox Church--Rates of adherence per 1000 population (2000)                                  
GRORART  Greek Orthodox Archdiocese of America--Rates of adherence per 1000 population (2000)                   
GRORVRT  Greek Orthodox Archdiocese of Vasiloupulis--Rates of adherence per 1000 population (2000)              
HLYORRT  Holy Orthodox Church in North America--Rates of adherence per 1000 population (2000)                   
MACORRT  Macedonian Orthodox Church: American Diocese--Rates of adherence per 1000 population (2000)            
MLKADRT  Malankara Orthodox Syrian Church, American Diocese--Rates of adherence per 1000 population (2000)      
MLKSYRT  Malankara Archdiocese, Syrian Orthodox Church in North America--Rates of adherence per 1000 population (2000)  
OCABDRT  Orthodox Church in America: Bulgarian Diocese--Rates of adherence per 1000 population (2000)           
OCATDRT  Orthodox Church in America: Territorial Dioceses--Rates of adherence per 1000 population (2000)        
ORPRSRT  Orthodox Presbyterian Church--Rates of adherence per 1000 population (2000)                            
ORTHRT   Orthodox Denominations--Rates of adherence per 1000 population (2000)                                  
RMOACRT  Romanian Orthodox Archdiocese in America and Canada--Rates of adherence per 1000 population (2000)     
RMOEART  Orthodox Church in America: Romanian Orthodox Episcopate of America--Rates of adherence per 1000 population (2000)   
ROORRT   Russian Orthodox Church Outside of Russia--Rates of adherence per 1000 population (2000)               
ROUSART  Patriarchal Parishes of the Russian Orthodox Church in the USA--Rates of adherence per 1000 population (2000)  
SRBGMRT  Serbian Orthodox Church USA (New Gracanica Metropolitanate)--Rates of adherence per 1000 population (2000) 
SRBUSRT  Serbian Orthodox Church in the USA--Rates of adherence per 1000 population (2000)                      
SYRANRT  Syrian Orthodox Church of Antioch--Rates of adherence per 1000 population (2000)                       
UKORTRT  Ukranian Orthodox Church of the USA--Rates of adherence per 1000 population (2000)                     
EAORRT   American Carpatho-Russian Orthodox Greek Catholic Church--Rates of adherence per 1000 population (2000)
ANTAMRT  Antiochian Orthodox Christian Archdiocese of North America--Rates of adherence per 1000 population (2000) 
*/

 sum(INPCCRT, PNTCGRT, PNTHORT, ASSGDRT) as Pentecostal, 
/*
INPCCRT  International Pentecostal Church of Christ--Rates of adherence per 1000 population (2000)              
PNTCGRT  Pentecostal Church of God--Rates of adherence per 1000 population (2000)                               
PNTHORT  International Pentecostal Holiness Church--Rates of adherence per 1000 population (2000)               
Looks like they called this one 'Pentecostal'?  (or maybe not?)
ASSGDRT  Assemblies of God--Rates of adherence per 1000 population (2000)                                       
*/

 sum(CUPRSRT, EVPRSRT, PRAMRT, PRUSART, ASSPRRT) as Presbyterian,
/*
CUPRSRT  Cumberland Presbyterian Church--Rates of adherence per 1000 population (2000)                          
EVPRSRT  Evangelical Presbyterian Church--Rates of adherence per 1000 population (2000)                         
PRAMRT   Presbyterian Church in America--Rates of adherence per 1000 population (2000)                          
PRUSART  Presbyterian Church (USA)--Rates of adherence per 1000 population (2000)                               
ASSPRRT  Association Reformed Presbyterian Church--Rates of adherence per 1000 population (2000)                
*/

 EPISCRT as Anglican,
/*
Looks like they called Episcopal 'Anglican'?
EPISCRT  Episcopal Church--Rates of adherence per 1000 population (2000)                                        
*/

/* 
And now, all the other ones, "just in case" one of them has a high percentage
*/
NTHRFRT, 
PREFCRT,
APCATRT,
ARMCIRT,
ARMETRT,
MRVALRT,
MRVNPRT,
MRVSPRT,
BRUDCRT,
CALVRT ,
CHGANRT,
CHGCLRT,
CHGGCRT,
CHGPRRT,
CHSGGRT,
EVFRERT,
FLEVBRT,
INCCCRT,
INCHCRT,
INDCHRT,
INDNCRT,
INFSGRT,
JAINSRT,
METCHRT,
MISCHRT,
UNIUNRT,
VINERT,
JEWRT ,
ZOARRT,
NAZARRT,
HINDURT,
SIKHSRT,
/* Eliminate these two, since they didn't show up in the original map */
/* 
ISLAMRT, 
SALARRT,
*/
TAOCRT ,
BUDDHRT,
BAHAIRT

/*
APCATRT  Apostolic Catholic Assyrian Church of the East, North America--Rates of adherence per 1000 population (2000) 
ARMCIRT  Armenian Apostolic Church/Catholicossate of Cilicia--Rates of adherence per 1000 population (2000)     
ARMETRT  Armenian Apostolic Church/Catholicossate Etchmiadzin--Rates of adherence per 1000 population (2000)    
MRVALRT  Moravian Church in America--Alaska Province--Rates of adherence per 1000 population (2000)             
MRVNPRT  Moravian Church in America--Northern Province--Rates of adherence per 1000 population (2000)           
MRVSPRT  Moravian Church in America--Southern Province--Rates of adherence per 1000 population (2000)           
BRUDCRT  Bruderhof Communities, Inc.--Rates of adherence per 1000 population (2000)                             
CALVRT   Calvary Chapel Fellowship Churches--Rates of adherence per 1000 population (2000)                      
CHGANRT  Church of  God (Anderson, Indiana)--Rates of adherence per 1000 population (2000)                      
CHGCLRT  Church of God (Cleveland, Tennessee)--Rates of adherence per 1000 population (2000)                    
CHGGCRT  Church of God General Conference--Rates of adherence per 1000 population (2000)                        
CHGPRRT  Church of God of Prophecy--Rates of adherence per 1000 population (2000)                               
CHSGGRT  Churches of God, General Conference--Rates of adherence per 1000 population (2000)                     
EVFRERT  Evangelical Free Church of America--Rates of adherence per 1000 population (2000)                      
FLEVBRT  Fellowship of Evangelical Bible Churches--Rates of adherence per 1000 population (2000)                
INCCCRT  International Council of Community Churches--Rates of adherence per 1000 population (2000)             
INCHCRT  International Churches of Christ--Rates of adherence per 1000 population (2000)                        
INDCHRT  Independent, Charismatic Churches--Rates of adherence per 1000 population (2000)                       
INDNCRT  Independent, Non-Charismatic Churches--Rates of adherence per 1000 population (2000)                   
INFSGRT  International Church of the Foursquare Gospel--Rates of adherence per 1000 population (2000)           
JAINSRT  Jains--Rates of adherence per 1000 population (2000)                                                   
METCHRT  Universal Fellowship of Metropolitan Community Churches--Rates of adherence per 1000 population (2000) 
MISCHRT  Missionary Church--Rates of adherence per 1000 population (2000)                                       
UNIUNRT  Unitarian Universalist Association--Rates of adherence per 1000 population (2000)                      
VINERT   Vineyard USA--Rates of adherence per 1000 population (2000)                                            
JEWRT    Jewish Estimate--Rates of adherence per 1000 population (2000)                                         
ZOARRT   Zoroastrians--Rates of adherence per 1000 population (2000)                                            
NAZARRT  Church of the Nazarene--Rates of adherence per 1000 population (2000)                                  
HINDURT  Hindus--Rates of adherence per 1000 population (2000)                                                  
SIKHSRT  Sikhs--Rates of adherence per 1000 population (2000)                                                   
TAOCRT   Taoists--Rates of adherence per 1000 population (2000)                                                 
BUDDHRT  Buddhists--Rates of adherence per 1000 population (2000)                                               
BAHAIRT  Baha'i--Rates of adherence per 1000 population (2000)                                                  
ISLAMRT  Muslim Estimate--Rates of aherence per 1000 population (2000)                                          
Note that islamrt was actually the highest in Manassas Park, VA
but that area is so small you can't see it on the map.

SALARRT  Salvation Army--Rates of adherence per 1000 population (2000)                                          
This was the highest 'religion' in one of the Alaska counties,
but I'm eliminating it since they didn't include it in the 
original map.
OTHERRT  Other Denominations--Rates of adherence per 1000 population (2000)                                     
MAINRT   Mainline Denominations--Rates of adherence per 1000 population (2000)                                  
EVANRT   Evangelical Denominations--Rates of adherence per 1000 population (2000)                               
*/


Back to Samples Index