library(data.table) #fread
library(sp) #used by rgdal
library(rgdal) #readOGR
library(ggplot2) #fortify
library(plyr) #join
library(dplyr) #left_join
library(scales) #percent
library(viridisLite)
library(viridis)
library(openintro) #state2abbr
library(rgeos) #gCentroid
library(cdlTools) #fips
library(ggmap) #theme_nothing

ARIS 2008

ARIS (American Religious Identification Survey)

The Association of Religion Data Archives (ARDA)

American Religious Identification Survey, 2008

The American Religious Identification Survey (ARIS) 2008 is the third in a landmark time series of large, nationally representative surveys that track changes in the religious loyalties of the U.S. adult population within the 28 contiguous states from 1990 to 2008. The 2001 and 2008 surveys are replicas of the 1990 survey, and are led by the same academic research team using an identical methodology of random-digit-dialed telephone interviews (RDD) and the same unprompted, open-ended key question “What is your religion, if any?” Interviewers did not prompt or offer a suggested list of potential answers. Moreover, the self-description of respondents was not based on whether established religious bodies or institutions considered them to be members. To the contrary, the surveys sought to determine whether the respondents regarded themselves as adherents of a religious community. The surveys tap subjective, rather than objective, standards of religious identification. The value of this unique series of national surveys, which allows scientific monitoring of change over time, has been recognized by the U.S. Bureau of the Census The Bureau itself is constitutionally precluded from such an inquiry into religion, and so has incorporated NSRI/ARIS findings into its official publication the Statistical Abstract of the United States since 2003.

Cases: 54,461
Variables: 33
Weight Variable: POPWGHT
Date Collected: February - November 2008

cf. Religious Population by State

ARIS2008 <- fread("ARIS2008.csv")
str(ARIS2008)
Classes ‘data.table’ and 'data.frame':  54461 obs. of  38 variables:
 $ CASEID    : int  102 166 184 199 228 255 283 285 297 316 ...
 $ WEEK      : int  203 203 203 203 203 203 203 203 203 203 ...
 $ POPWGHT   : num  0.412 1.884 0.915 0.927 0.062 ...
 $ STATE     : chr  "GA" "TX" "AZ" "CA" ...
 $ DMA       : int  524 709 753 807 524 501 537 521 810 807 ...
 $ NEILSEN   : chr  "D" "D" "B" "A" ...
 $ COUNTYC   : int  137 401 15 81 59 25 19 5 77 85 ...
 $ ADI       : int  197 323 275 65 197 9 357 47 339 65 ...
 $ METRO     : chr  "Non-Metro" "Non-Metro" "Suburban (Metro)" "Suburban (Metro)" ...
 $ REGION    : chr  "South" "South" "West" "West" ...
 $ DIVISION  : chr  "South Atlantic" "West South Central" "Mountain" "Pacific" ...
 $ OWNHOME   : chr  "Rented" "Rented" "Rented" "Owned" ...
 $ MARITAL   : chr  "Single, living with a partner" "Single, living with a partner" "Married" "Married" ...
 $ HEADHH    : chr  "Don't know" "No" "No" "Yes" ...
 $ EMPLOY    : chr  "Temporarily unemployed" "Other not employed" "Housewife" "Full-time" ...
 $ HHCOMP    : chr  "Six" "Refused" "Five" "Four" ...
 $ ADULTS    : chr  "Two" "" "Two" "Two" ...
 $ ADULTM    : chr  "One" "" "One" "One" ...
 $ ADULTF    : chr  "One" "" "One" "One" ...
 $ KIDS1217  : chr  "Three" "" "None" "Two" ...
 $ KIDS611   : chr  "None" "" "Three" "None" ...
 $ KIDS06    : chr  "One" "" "None" "None" ...
 $ AGE       : chr  "35" "19" "27" "40" ...
 $ EDUC      : chr  "Less than high school graduate" "Refused" "High school graduate" "High school graduate" ...
 $ INCOME    : chr  "Don't know" "Refused" "Less than $10,000" "$75,000 but less than $100,000" ...
 $ RACE      : chr  "Black Hispanic" "White Hispanic" "White Hispanic" "Unspecified" ...
 $ POLAFFIL  : chr  "Refused" "Refused" "An Independent" "A Democrat" ...
 $ REGVOTE   : chr  "No" "Refused" "No" "Yes" ...
 $ OTHTEL    : chr  "None" "Refused" "None" "None" ...
 $ SEX       : chr  "Male" "Female" "Female" "Female" ...
 $ RELIG     : chr  "Don't know" "Catholic, Roman Catholic" "Apostolic/New Apostolic" "Catholic, Roman Catholic" ...
 $ RELIG2    : chr  "" "" "" "" ...
 $ RELIG3    : chr  "" "" "" "" ...
 $ I_SEX     : chr  "Male" "Female" "Female" "Female" ...
 $ I_MARITAL : chr  "Single" "Single" "Married" "Married" ...
 $ I_EDUC    : chr  "Less than high school graduate" "" "High school graduate" "High school graduate" ...
 $ I_PARTYID : chr  "" "" "An Independent or other affiliation" "A Democrat" ...
 $ I_RELIGION: chr  "" "Catholic" "Other religion" "Catholic" ...
 - attr(*, ".internal.selfref")=<externalptr> 

Religions by Frequencies

major <- names(head(sort(prop.table(table(ARIS2008$RELIG)), decreasing=TRUE), 17))

major
 [1] "Catholic, Roman Catholic"                          
 [2] "Christian"                                         
 [3] "No religion/none"                                  
 [4] "Baptist"                                           
 [5] "Protestant"                                        
 [6] "Refused"                                           
 [7] "Lutheran"                                          
 [8] "Methodist/Wesleyan"                                
 [9] "Presbyterian"                                      
[10] "Jewish, Judaism"                                   
[11] "Mormon/Church of Jesus Christ of Latter-day Saints"
[12] "Pentecostal"                                       
[13] "Non-denominational Christian"                      
[14] "United Methodist"                                  
[15] "Episcopalian/Anglican"                             
[16] "Don't know"                                        
[17] "Southern Baptist"                                  
ARIS2008_major <- ARIS2008[RELIG %in% major,]

nrow(ARIS2008_major)
[1] 50287
ggplot(ARIS2008_major, aes(RELIG)) +
  geom_bar(mapping = aes(x = RELIG, y = ..prop.., group = 1), stat = "count") +
  scale_y_continuous(labels = scales::percent) +
  coord_flip()+theme(axis.text = element_text(size = 7))

Contingency Tables

prop.table(table(ARIS2008_major$RELIG, ARIS2008_major$POLAFFIL), margin=1)
                                                    
                                                      A Democrat A Republican An Independent
  Baptist                                            0.409696970  0.284155844    0.230129870
  Catholic, Roman Catholic                           0.349144171  0.262624542    0.302733543
  Christian                                          0.254428537  0.369570493    0.302353798
  Don't know                                         0.300601202  0.140280561    0.364729459
  Episcopalian/Anglican                              0.336092715  0.324503311    0.286423841
  Jewish, Judaism                                    0.527412281  0.143640351    0.279605263
  Lutheran                                           0.300906056  0.346208870    0.271816881
  Methodist/Wesleyan                                 0.345850999  0.336765597    0.252574197
  Mormon/Church of Jesus Christ of Latter-day Saints 0.117496807  0.549169860    0.263090677
  No religion/none                                   0.345891966  0.142532910    0.410198215
  Non-denominational Christian                       0.273087071  0.306068602    0.329815303
  Pentecostal                                        0.373056995  0.278497409    0.237046632
  Presbyterian                                       0.287575150  0.405811623    0.256513026
  Protestant                                         0.266201009  0.383391541    0.289483896
  Refused                                            0.214257109  0.136964357    0.299959952
  Southern Baptist                                   0.295711061  0.415349887    0.250564334
  United Methodist                                   0.333333333  0.344000000    0.264000000
                                                    
                                                      Don't know       Other     Refused
  Baptist                                            0.036190476 0.009696970 0.030129870
  Catholic, Roman Catholic                           0.034403474 0.013625138 0.037469131
  Christian                                          0.029119146 0.016622179 0.027905848
  Don't know                                         0.112224449 0.016032064 0.066132265
  Episcopalian/Anglican                              0.013245033 0.014900662 0.024834437
  Jewish, Judaism                                    0.010964912 0.014254386 0.024122807
  Lutheran                                           0.033381021 0.012398665 0.035288507
  Methodist/Wesleyan                                 0.031496063 0.004239855 0.029073289
  Mormon/Church of Jesus Christ of Latter-day Saints 0.029374202 0.014048531 0.026819923
  No religion/none                                   0.044484793 0.018610985 0.038281132
  Non-denominational Christian                       0.032981530 0.022427441 0.035620053
  Pentecostal                                        0.050518135 0.014248705 0.046632124
  Presbyterian                                       0.016032064 0.013026052 0.021042084
  Protestant                                         0.022700815 0.009507179 0.028715561
  Refused                                            0.022426912 0.019223068 0.307168602
  Southern Baptist                                   0.015801354 0.011286682 0.011286682
  United Methodist                                   0.024000000 0.008000000 0.026666667
prop.table(table(ARIS2008_major$RELIG, ARIS2008_major$REGVOTE), margin=1)
                                                    
                                                      Don't know          No     Refused         Yes
  Baptist                                            0.004675325 0.128658009 0.007099567 0.859567100
  Catholic, Roman Catholic                           0.003235970 0.133866985 0.014221238 0.848675807
  Christian                                          0.005095851 0.140499879 0.007037127 0.847367144
  Don't know                                         0.018036072 0.214428858 0.018036072 0.749498998
  Episcopalian/Anglican                              0.003311258 0.086092715 0.003311258 0.907284768
  Jewish, Judaism                                    0.008771930 0.081140351 0.006578947 0.903508772
  Lutheran                                           0.004768717 0.090605627 0.007153076 0.897472580
  Methodist/Wesleyan                                 0.003634161 0.083585706 0.008479709 0.904300424
  Mormon/Church of Jesus Christ of Latter-day Saints 0.002554278 0.108556833 0.003831418 0.885057471
  No religion/none                                   0.005144500 0.188076865 0.008473294 0.798305341
  Non-denominational Christian                       0.003957784 0.160949868 0.003957784 0.831134565
  Pentecostal                                        0.010362694 0.176165803 0.007772021 0.805699482
  Presbyterian                                       0.000000000 0.067134269 0.007014028 0.925851703
  Protestant                                         0.002716337 0.077609624 0.005820722 0.913853318
  Refused                                            0.004405286 0.082098518 0.148177813 0.765318382
  Southern Baptist                                   0.004514673 0.110609481 0.004514673 0.880361174
  United Methodist                                   0.002666667 0.078666667 0.002666667 0.916000000

State FIPS Codes

sort(unique(ARIS2008$STATE))
 [1] "AL" "AR" "AZ" "CA" "CO" "CT" "DC" "DE" "FL" "GA" "IA" "ID" "IL" "IN" "KS" "KY" "LA" "MA" "MD"
[20] "ME" "MI" "MN" "MO" "MS" "MT" "NC" "ND" "NE" "NH" "NJ" "NM" "NV" "NY" "OH" "OK" "OR" "PA" "RI"
[39] "SC" "SD" "TN" "TX" "UT" "VA" "VT" "WA" "WI" "WV" "WY"

State FIPS Codes

lower_48 <- c("01", "04", "05", "06", "08", "09", "10", "11", "12", "13", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49", "50", "51", "53", "54", "55", "56")

States Shapefile

United States Census Bureau, Cartographic Boundary Files - Shapefile

cb_2018_us_state_500k.zip

states.sh <- readOGR("C:/Users/14165/Desktop/Shapefiles/cb_2018_us_state_500k", "cb_2018_us_state_500k", stringsAsFactors=FALSE)
OGR data source with driver: ESRI Shapefile 
Source: "C:\Users\14165\Desktop\Shapefiles\cb_2018_us_state_500k", layer: "cb_2018_us_state_500k"
with 56 features
It has 9 fields
Integer64 fields read as strings:  ALAND AWATER 
str(states.sh@data)
'data.frame':   56 obs. of  9 variables:
 $ STATEFP : chr  "28" "37" "40" "51" ...
 $ STATENS : chr  "01779790" "01027616" "01102857" "01779803" ...
 $ AFFGEOID: chr  "0400000US28" "0400000US37" "0400000US40" "0400000US51" ...
 $ GEOID   : chr  "28" "37" "40" "51" ...
 $ STUSPS  : chr  "MS" "NC" "OK" "VA" ...
 $ NAME    : chr  "Mississippi" "North Carolina" "Oklahoma" "Virginia" ...
 $ LSAD    : chr  "00" "00" "00" "00" ...
 $ ALAND   : chr  "121533519481" "125923656064" "177662925723" "102257717110" ...
 $ AWATER  : chr  "3926919758" "13466071395" "3374587997" "8528531774" ...
states_lower48.sh <- states.sh[states.sh@data$GEOID %in% lower_48,]
str(states_lower48.sh@data)
'data.frame':   49 obs. of  9 variables:
 $ STATEFP : chr  "28" "37" "40" "51" ...
 $ STATENS : chr  "01779790" "01027616" "01102857" "01779803" ...
 $ AFFGEOID: chr  "0400000US28" "0400000US37" "0400000US40" "0400000US51" ...
 $ GEOID   : chr  "28" "37" "40" "51" ...
 $ STUSPS  : chr  "MS" "NC" "OK" "VA" ...
 $ NAME    : chr  "Mississippi" "North Carolina" "Oklahoma" "Virginia" ...
 $ LSAD    : chr  "00" "00" "00" "00" ...
 $ ALAND   : chr  "121533519481" "125923656064" "177662925723" "102257717110" ...
 $ AWATER  : chr  "3926919758" "13466071395" "3374587997" "8528531774" ...

Add “id” column

states_lower48.sh@data$id <- as.integer(states_lower48.sh@data$GEOID)
sort(states_lower48.sh@data$id)
 [1]  1  4  5  6  8  9 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
[33] 38 39 40 41 42 44 45 46 47 48 49 50 51 53 54 55 56
states_lower48.sh@data$STATE <- as.character(states_lower48.sh@data$STUSPS)

Shapefile processing

states_lower48.points = fortify(states_lower48.sh, region = "id")

states_lower48.df = join(states_lower48.points, states_lower48.sh@data, by = "id")

State Religious Ratios and Choropleths

Totals2008 <- ARIS2008[, .(.N), by = .(STATE)]

Totals2008 <- Totals2008[order(STATE)]

Catholics

Catholics2008 <- ARIS2008[RELIG == "Catholic, Roman Catholic", .(.N), by = .(STATE)]

Catholics2008 <- Catholics2008[order(STATE)]

Catholics2008$ratio <- Catholics2008$N/Totals2008$N

Catholics2008_lower48 <- merge(states_lower48.df, Catholics2008, by = "STATE")

Catholics2008_lower48 <- Catholics2008_lower48[order(Catholics2008_lower48$STATE), ]

Make and plot choropleth

ggplot() +
  geom_polygon(data = Catholics2008_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Catholics") +
   labs(title="Ratios of Catholics by State, ARIS2008")

Baptists

Baptists2008 <- ARIS2008[RELIG == "Baptist", .(.N), by = .(STATE)]

Baptists2008 <- Baptists2008[order(STATE)]

Baptists2008$ratio <- Baptists2008$N/Totals2008$N

Baptists2008_lower48 <- merge(states_lower48.df, Baptists2008, by = "STATE")

Baptists2008_lower48 <- Baptists2008_lower48[order(Baptists2008_lower48$STATE), ]

Make and plot choropleth

ggplot() +
  geom_polygon(data = Baptists2008_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Baptists") +
   labs(title="Ratios of Baptists by State, ARIS 2008")

No Religion

Noreligion2008 <- ARIS2008[RELIG == "No religion/none", .(.N), by = .(STATE)]

Noreligion2008 <- Noreligion2008[order(STATE)]

Noreligion2008$ratio <- Noreligion2008$N/Totals2008$N

Noreligion2008_lower48 <- merge(states_lower48.df, Noreligion2008, by = "STATE")

Noreligion2008_lower48 <- Noreligion2008_lower48[order(Noreligion2008_lower48$STATE), ]

Make and plot choropleth

ggplot() +
  geom_polygon(data = Noreligion2008_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="No Religion") +
   labs(title="Ratios of No Religion by State, ARIS 2008")

ARIS 2001

Download ARIS 2001 Data

ARIS2001SPSS.zip

ARIS2001 <- fread("ARIS2001.csv")

ARIS 2001 Codebook

ARIS2001 <- ARIS2001[, .(POPWGHT = wgt_pop, STATE = state, COUNTYFIPS = fips, ADI = adi, DMA = dma, MSA = msa, METRO = metro, NIELSEN = neilsen, DIVISION = cen_div, REGION = region, SEX = gender, OWNHOME = dem2, MARITAL = dem3, EMPLOY = dem4, INCOME = newdem9, AGE = dem7, EDUC = dem8, HISPANIC = dem10, RACE = dem11, RELIG = jq1tot, RELIG_SPOUSE = jq2tot, AGECAT = agecat, POLAFFIL = z11a, REGVOTE = z11b)]
ARIS2001$STATE <- state2abbr(ARIS2001$STATE)
major_2001 <- names(head(sort(prop.table(table(ARIS2001$RELIG)), decreasing=TRUE), 17))

major_2001
 [1] "Catholic"                                "Baptist"                                
 [3] "None"                                    "Methodist/Wesleyan"                     
 [5] "Christian"                               "Refused"                                
 [7] "Lutheran"                                "Presbyterian"                           
 [9] "Protestant"                              "Pentecostal/Charismatics"               
[11] "Southern Baptist"                        "Episcopalian"                           
[13] "Mormon/Latter Day Saints"                "Churches of Christ & Christian Churches"
[15] "Non-denominational"                      "Jewish/Judaism"                         
[17] "United Church of Christ/Congregational" 
ARIS2001_major <- ARIS2001[RELIG %in% major_2001,]

nrow(ARIS2001_major)
[1] 46021
ggplot(ARIS2001_major, aes(RELIG)) +
  geom_bar(mapping = aes(x = RELIG, y = ..prop.., group = 1), stat = "count") +
  scale_y_continuous(labels = scales::percent) +
  coord_flip()+theme(axis.text = element_text(size = 7))

Totals2001 <- ARIS2001[, .(.N), by = .(STATE)]

Totals2001 <- Totals2001[order(STATE)]

Catholics

Catholics2001 <- ARIS2001[RELIG == "Catholic", .(.N), by = .(STATE)]

Catholics2001 <- Catholics2001[order(STATE)]

Catholics2001$ratio <- Catholics2001$N/Totals2001$N

Catholics2001_lower48 <- merge(states_lower48.df, Catholics2001, by = "STATE")

Catholics2001_lower48 <- Catholics2001_lower48[order(Catholics2001_lower48$STATE), ]

Make and plot choropleth

ggplot() +
  geom_polygon(data = Catholics2001_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Catholics") +
   labs(title="Ratios of Catholics by State, ARIS 2001")

Baptists

Baptists2001 <- ARIS2001[RELIG == "Baptist", .(.N), by = .(STATE)]

Baptists2001 <- Baptists2001[order(STATE)]

Baptists2001$ratio <- Baptists2001$N/Totals2001$N

Baptists2001_lower48 <- merge(states_lower48.df, Baptists2001, by = "STATE")

Baptists2001_lower48 <- Baptists2001_lower48[order(Baptists2001_lower48$STATE), ]

ggplot() +
  geom_polygon(data = Baptists2001_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Baptists") +
   labs(title="Ratios of Baptists by State, ARIS 2001")

No Religion

Noreligion2001 <- ARIS2001[RELIG == "None", .(.N), by = .(STATE)]

Noreligion2001 <- Noreligion2001[order(STATE)]

Noreligion2001$ratio <- Noreligion2001$N/Totals2001$N

Noreligion2001_lower48 <- merge(states_lower48.df, Noreligion2001, by = "STATE")

Noreligion2001_lower48 <- Noreligion2001_lower48[order(Noreligion2001_lower48$STATE), ]

ggplot() +
  geom_polygon(data = Noreligion2001_lower48, 
               aes(x = long, y = lat, group = group, fill = ratio), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="No Religion") +
   labs(title="Ratios of No Religion by State, ARIS 2001")

Change from 2001 to 2008

Catholics

Catholics2008$change <- (Catholics2008$ratio-Catholics2001$ratio)/Catholics2001$ratio
Catholics2008change_lower48 <- merge(states_lower48.df, Catholics2008, by = "STATE")

Catholics2008change_lower48 <- Catholics2008change_lower48[order(Catholics2008change_lower48$STATE), ]

Make and plot choropleth

ggplot() +
  geom_polygon(data = Catholics2008change_lower48, 
               aes(x = long, y = lat, group = group, fill = change), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Change") +
   labs(title="(ARIS2008-ARIS2001)/ARIS2001, Catholics")

Baptists

Baptists2008$change <- (Baptists2008$ratio-Baptists2001$ratio)/Baptists2001$ratio

Baptists2008change_lower48 <- merge(states_lower48.df, Baptists2008, by = "STATE")

Baptists2008change_lower48 <- Baptists2008change_lower48[order(Baptists2008change_lower48$STATE), ]

ggplot() +
  geom_polygon(data = Baptists2008change_lower48, 
               aes(x = long, y = lat, group = group, fill = change), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Change") +
   labs(title="(ARIS2008-ARIS2001)/ARIS2001, Baptists")

No Religion

Noreligion2008$change <- (Noreligion2008$ratio-Noreligion2001$ratio)/Noreligion2001$ratio

Noreligion2008change_lower48 <- merge(states_lower48.df, Noreligion2008, by = "STATE")

Noreligion2008change_lower48 <- Noreligion2008change_lower48[order(Noreligion2008change_lower48$STATE), ]

ggplot() +
  geom_polygon(data = Noreligion2008change_lower48, 
               aes(x = long, y = lat, group = group, fill = change), 
               color = "white", size = 0.1) + 
  coord_map() + 
  scale_fill_viridis(option="magma", labels=percent, name="Change") +
   labs(title="(ARIS2008-ARIS2001)/ARIS2001, No Religion")

ARIS 2008 Density Maps

State and County FIPS Codes

State FIPS Codes

County FIPS Codes

ARIS2008_counties <- ARIS2008[,.(COUNTYFIPS = COUNTYC, STATE, RELIG)]

ARIS2008_counties$STATEFIPS <- fips(ARIS2008_counties$STATE, to = "FIPS")

Counties Shapefile

United States Census Bureau, Cartographic Boundary Files - Shapefile

cb_2018_us_county_500k.zip

counties.sh <- readOGR("C:/Users/14165/Desktop/Shapefiles/cb_2018_us_county_500k", "cb_2018_us_county_500k", stringsAsFactors=FALSE)
OGR data source with driver: ESRI Shapefile 
Source: "C:\Users\14165\Desktop\Shapefiles\cb_2018_us_county_500k", layer: "cb_2018_us_county_500k"
with 3233 features
It has 9 fields
Integer64 fields read as strings:  ALAND AWATER 
str(counties.sh@data)
'data.frame':   3233 obs. of  9 variables:
 $ STATEFP : chr  "21" "21" "21" "21" ...
 $ COUNTYFP: chr  "007" "017" "031" "065" ...
 $ COUNTYNS: chr  "00516850" "00516855" "00516862" "00516879" ...
 $ AFFGEOID: chr  "0500000US21007" "0500000US21017" "0500000US21031" "0500000US21065" ...
 $ GEOID   : chr  "21007" "21017" "21031" "21065" ...
 $ NAME    : chr  "Ballard" "Bourbon" "Butler" "Estill" ...
 $ LSAD    : chr  "06" "06" "06" "06" ...
 $ ALAND   : chr  "639387454" "750439351" "1103571974" "655509930" ...
 $ AWATER  : chr  "69473325" "4829777" "13943044" "6516335" ...
counties_lower48.sh <- counties.sh[counties.sh@data$STATEFP %in% lower_48,]
counties_lower48.sh@data$STATEFIPS <- as.integer(counties_lower48.sh@data$STATEFP)

counties_lower48.sh@data$COUNTYFIPS <- as.integer(counties_lower48.sh@data$COUNTYFP)
counties_lower48.centroids  <- as.data.table(gCentroid(counties_lower48.sh, byid = TRUE))

counties_lower48.centroids$STATEFIPS <- counties_lower48.sh@data$STATEFIPS

counties_lower48.centroids$COUNTYFIPS <- counties_lower48.sh@data$COUNTYFIPS
str(counties_lower48.centroids)
Classes ‘data.table’ and 'data.frame':  3108 obs. of  4 variables:
 $ x         : num  -89 -84.2 -86.7 -84 -83.7 ...
 $ y         : num  37.1 38.2 37.2 37.7 38.4 ...
 $ STATEFIPS : int  21 21 21 21 21 21 21 21 21 21 ...
 $ COUNTYFIPS: int  7 17 31 65 69 93 99 131 151 155 ...
 - attr(*, ".internal.selfref")=<externalptr> 
str(ARIS2008_counties)
Classes ‘data.table’ and 'data.frame':  54461 obs. of  4 variables:
 $ COUNTYFIPS: int  137 401 15 81 59 25 19 5 77 85 ...
 $ STATE     : chr  "GA" "TX" "AZ" "CA" ...
 $ RELIG     : chr  "Don't know" "Catholic, Roman Catholic" "Apostolic/New Apostolic" "Catholic, Roman Catholic" ...
 $ STATEFIPS : int  13 48 4 6 13 34 23 25 53 6 ...
 - attr(*, ".internal.selfref")=<externalptr> 
ARIS2008_XY <- left_join(ARIS2008_counties, counties_lower48.centroids, by = c("STATEFIPS", "COUNTYFIPS"))
ARIS2008_XY$COUNTYFIPS <- NULL

ARIS2008_XY$STATE <- NULL

ARIS2008_XY$STATEFIPS <- NULL

str(ARIS2008_XY)
'data.frame':   54461 obs. of  3 variables:
 $ RELIG: chr  "Don't know" "Catholic, Roman Catholic" "Apostolic/New Apostolic" "Catholic, Roman Catholic" ...
 $ x    : num  -83.5 -94.8 -113.8 -122.3 -83.4 ...
 $ y    : num  34.6 32.1 35.7 37.4 34 ...
Catholics2008_XY <- ARIS2008_XY[ARIS2008_XY$RELIG == "Catholic, Roman Catholic",]

Catholics2008_XY$RELIG <- NULL
Baptists2008_XY <- ARIS2008_XY[ARIS2008_XY$RELIG == "Baptist",]

Baptists2008_XY$RELIG <- NULL
Noreligion2008_XY <- ARIS2008_XY[ARIS2008_XY$RELIG == "No religion/none",]

Noreligion2008_XY$RELIG <- NULL

Catholic Density Map

ggplot() + 
  geom_polygon(data = states_lower48.df, aes(x = long, y = lat, group = group),
          color = 'black', size = 1, fill=NA) +
  stat_density2d(data=Catholics2008_XY, aes(x=x, y=y, fill=..level..), alpha=0.2, geom = 'polygon', colour = 'black', contour=TRUE) +
  scale_fill_continuous(low="yellow", high="red")+
  theme_nothing(legend = TRUE) +   
  labs(title="Catholic Denity Map, ARIS 2008")

Baptist Density Map

ggplot() + 
  geom_polygon(data = states_lower48.df, aes(x = long, y = lat, group = group),
          color = 'black', size = 1, fill=NA) +
  stat_density2d(data=Baptists2008_XY, aes(x=x, y=y, fill=..level..), alpha=0.2, geom = 'polygon', colour = 'black', contour=TRUE) +
  scale_fill_continuous(low="yellow",high="red")+
  theme_nothing(legend = TRUE) +  
  labs(title="Baptist Density Map, ARIS 2008")

No Religion Density Map

ggplot() + 
  geom_polygon(data = states_lower48.df, aes(x = long, y = lat, group = group),
          color = 'black', size = 1, fill=NA) +
  stat_density2d(data=Noreligion2008_XY, aes(x=x, y=y, fill=..level..), alpha=0.2, geom = 'polygon', colour = 'black', contour=TRUE) +
  scale_fill_continuous(low="yellow",high="red")+
  theme_nothing(legend = TRUE) +  
  labs(title="No Religion Density Map, ARIS 2008")

LS0tDQp0aXRsZTogIkFtZXJpY2FuIFJlbGlnaW91cyBJZGVudGlmaWNhdGlvbiBTdXJ2ZXkgKEFSSVMpIERhdGFzZXRzLCAyMDA4IGFuZCAyMDAxIg0Kb3V0cHV0OiANCiAgaHRtbF9ub3RlYm9vazogDQogICAgdG9jOiB5ZXMNCi0tLQ0KDQoqIEpvcmRhbiBCZWxsDQoqIEp1bHkgMTAsIDIwMTkNCiogPGh0dHBzOi8vam9yZGFuYmVsbDIzNTcuZ2l0aHViLmlvL0FSSVMubmIuaHRtbD4NCg0KDQpgYGB7cn0NCmxpYnJhcnkoZGF0YS50YWJsZSkgI2ZyZWFkDQpsaWJyYXJ5KHNwKSAjdXNlZCBieSByZ2RhbA0KbGlicmFyeShyZ2RhbCkgI3JlYWRPR1INCmxpYnJhcnkoZ2dwbG90MikgI2ZvcnRpZnkNCmxpYnJhcnkocGx5cikgI2pvaW4NCmxpYnJhcnkoZHBseXIpICNsZWZ0X2pvaW4NCmxpYnJhcnkoc2NhbGVzKSAjcGVyY2VudA0KbGlicmFyeSh2aXJpZGlzTGl0ZSkNCmxpYnJhcnkodmlyaWRpcykNCmxpYnJhcnkob3BlbmludHJvKSAjc3RhdGUyYWJicg0KbGlicmFyeShyZ2VvcykgI2dDZW50cm9pZA0KbGlicmFyeShjZGxUb29scykgI2ZpcHMNCmxpYnJhcnkoZ2dtYXApICN0aGVtZV9ub3RoaW5nDQpgYGANCg0KIyBBUklTIDIwMDgNCg0KW0FSSVMgKEFtZXJpY2FuIFJlbGlnaW91cyBJZGVudGlmaWNhdGlvbiBTdXJ2ZXkpXShodHRwczovL2NvbW1vbnMudHJpbmNvbGwuZWR1L2FyaXMvKQ0KDQpbVGhlIEFzc29jaWF0aW9uIG9mIFJlbGlnaW9uIERhdGEgQXJjaGl2ZXMgKEFSREEpXShodHRwOi8vd3d3LnRo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