PCA results

### Number of recommended classes

dat_dim5%>%
    dplyr::select(dim1,dim2,dim3,dim4,dim5) %>%
    single_imputation() %>%
    estimate_profiles(1:5, 
                      variances = c("equal", "varying"),
                      covariances = c("zero", "varying")
                      ) %>%
    compare_solutions(statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC      BIC      Warnings
##  1     1       22779.16 22829.63         
##  1     2       22316.16 22396.90         
##  1     3       22146.09 22257.12         
##  1     4       21554.44 21695.75         
##  1     5       19867.71 20039.30 Warning 
##  6     1       22799.16 22900.10         
##  6     2       19397.94 19604.85         
##  6     3       18655.28 18968.17         
##  6     4       17571.80 17990.67         
##  6     5       17184.59 17709.44         
## 
## Best model according to AIC is Model 6 with 5 classes.
## Best model according to BIC is Model 6 with 5 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 6 with 5 classes.

The best results with five dimensions and three, four, and five classes:

Three classes (Mclust)

y1 <- dat_dim5 %>% 
  dplyr::select(dim1,dim2,dim3,dim4,dim5) %>% 
  single_imputation() %>% 
  poms() %>% 
  estimate_profiles(3,
                    variances = "varying",
                    covariances = "varying") %>% 
  plot_profiles()

Four Classes (POMS and MplusAutomation)

y2<- dat_dim5 %>% 
  dplyr::select(dim1,dim2,dim3,dim4,dim5) %>% 
  single_imputation() %>% 
  poms() %>% 
  estimate_profiles(4,package = "MplusAutomation",
                    variances = "varying",
                    covariances = "varying") %>% 
  plot_profiles()
## Warning: 
## One or more analyses resulted in warnings! Examine these analyses carefully: model_6_class_4

v2 <- dat_dim5 %>% 
  dplyr::select(dim1,dim2,dim3,dim4,dim5) %>% 
  single_imputation() %>% 
  poms() %>% 
  estimate_profiles(4,package = "MplusAutomation",
                    variances = "varying",
                    covariances = "varying") %>% 
  get_data()
## Warning: 
## One or more analyses resulted in warnings! Examine these analyses carefully: model_6_class_4
dat_dim5$classv2 <- v2$Class
table(dat_dim5$classv2)
## 
##   1   2   3   4 
##  22 672 278 177

Utilizing the results of the PCA with four classes to give descriptions of the different classes

I’ll first lay out the location of each class within each dimension and then assign characteristics for that class based on high and low rankings:

5 Dimensions with 4 classes POMS, Mplus Automation

  • Class 1
    • D1: mid
    • D2: mid/lo
    • D3: low
    • D4: all encompassing
    • D5: mid
  • Class 2
    • D1: mid low
    • D2: low low
    • D3: mid
    • D4: mid top
    • D5: Mid
  • Class 3
    • D1: top
    • D2: low mid
    • D3: mid
    • D4: mid top
    • D5: low
  • Class 4
    • D1: low
    • D2: high separate
    • D3: top
    • D4: top
    • D5: top
      ### Characteristics of the classes
  • Class 1
    • Large numbers of building permits
    • Increase in population
  • Class 2
    • Decreasing nhb population
    • Increasing hisp population
  • Class 3
    • Increase nhw population
    • Increase in educ
    • Increase in mhhinc
    • Increase in population
  • Class 4
    • Decrease nhw
    • Decrease educ
    • Decrease mhhinc
    • Increase in nhb
    • Decrease in hisp
    • Increase in number of issued building permits
    • Increase in population
    • Low inc
      ## Map of the three cities with these classes
tracts_sf <- tracts(state = "TX",
                    county = c("453","113","029"),
                    year = "2010",
                    progress_bar = F)
tracts_sf_sub <- county_subdivisions(
                    state = "TX",
                    county = c("453","113","029"),
                    year = "2010",
                    progress_bar = F)


tracts_sf <- tracts_sf %>% 
  transmute(
    geoid = as.numeric(GEOID10),
    county = COUNTYFP10,
    geometry = geometry
  )
dat_dim5sf <- left_join(tracts_sf,dat_dim5)
## Joining, by = "geoid"
dat_dim5sf <- st_as_sf(dat_dim5sf)


dat2sub <- data.frame(dat2$geoid,dat2$geometry)
dat2sub <- dat2sub %>% 
  transmute(
    geoid = dat2.geoid,
    geometry = geometry
  )
dat2sub <- st_as_sf(dat2sub)
dat_dimsf <- left_join(dat_dim5,dat2sub)
## Joining, by = "geoid"
#bpsw <- bpsw[!duplicated(bpsw$geoid),]
dat_dimsf <- dat_dimsf %>% 
  distinct()
#dat_dimsf <- dat_dim[!duplicated(dat_dimsf$geoid),]
dat_dimsf <- st_as_sf(dat_dimsf)

tmap_mode("view")
## tmap mode set to interactive viewing
dat_dim5sf %>% 
  filter( city == "austin") %>% 
tm_shape()+
  tm_basemap("Esri.WorldStreetMap")+
  tm_polygons("classv2",legend.hist=T,
              style = "cat",
              palette = "Set2",
              alpha = .5,
              labels = c("One","Two" ,"Three", "Four"))+
  tm_layout(title = "Austin", 
            legend.outside = T)+
  tm_view(view.legend.position = c("right","bottom"))+
  tm_scale_bar()
dat_dim5sf %>% 
  filter( city == "dallas") %>% 
tm_shape()+
  tm_basemap("Esri.WorldStreetMap")+
  tm_polygons("classv2",legend.hist=T,
              style = "cat",
              palette = "Set2",
              alpha = .5,
              labels = c("One","Two" ,"Three", "Four"))+
  tm_layout(title = "Dallas", 
            legend.outside = T)+
  tm_view(view.legend.position = c("right","bottom"))+
  tm_scale_bar()
dat_dim5sf %>% 
  filter( city == "san_antonio") %>% 
tm_shape()+
  tm_basemap("Esri.WorldStreetMap")+
  tm_polygons("classv2",legend.hist=T,
              style = "cat",
              palette = "Set2",
              alpha = .5,
              labels = c("One","Two" ,"Three", "Four"))+
  tm_layout(title = "San Antonio", 
            legend.outside = T)+
  tm_view(view.legend.position = c("right","bottom"))+
  tm_scale_bar()
#### trouble shoot county subdivision
tracts_sf %>% 
  filter(county == "029") %>% 
  tm_shape()+
  tm_polygons()
tracts_sf_sub %>% 
  filter(COUNTYFP10 == "029") %>% 
  tm_shape() +
  tm_polygons("NAME10",
              style = "cat",
              palette = "Set2")

Five Classes (POMS and MplusAutomation):

y3<- dat_dim5 %>% 
  dplyr::select(dim1,dim2,dim3,dim4,dim5) %>% 
  single_imputation() %>% 
  poms() %>% 
  estimate_profiles(5,package = "MplusAutomation",
                    variances = "varying",
                    covariances = "varying") %>% 
  plot_profiles()
## Warning: 
## One or more analyses resulted in warnings! Examine these analyses carefully: model_6_class_5

5 Dimensions with 5 classes POMS, Mplus Automation

  • Class 1
    • D1: mid
    • D2: mid/lo
    • D3: low distinct
    • D4: low distinct
    • D5: high
  • Class 2
    • D1: low
    • D2: low low
    • D3: high mid
    • D4: high mid
    • D5: Mid
  • Class 3
    • D1: mid
    • D2: low mid
    • D3: high mid
    • D4: high mid
    • D5: mid
  • Class 4
    • D1: mid low
    • D2: high
    • D3: high mid
    • D4: high mid
    • D5: mid
  • Class 5
    • D1: high
    • D2: mid
    • D3: high
    • D4: high
    • D5: high ### Characteristics of the classes
  • Class 1
    • Small numbers of building permits
    • Decrease in population
    • Low number of increasing issued bldg permits in the 5 yr groups
  • Class 2
    • Decreasing nhw population
    • Decreasing edu
    • Decreasing mhhinc
    • Decreasing nhb
    • Increasing hisp
    • High number of blgd permits
    • Increasing pop
  • Class 3
    • Increase in population
  • Class 4
    • Increase in nhb
    • Decrease in hisp
    • Increase in population
  • Class 5
    • Increasing nhww
    • Decreasin hisp
    • Increasing edu
    • Increasing mhhinc
    • Higher number of issued bldg permits
    • Increasing population
    • Smaller number of increasing number of bldg permnits issued over the 5 yr groups