3d Plot of Data

(x_axis = Income, y_axis = Potential, z_axis = Population)

##ggplot(a, aes(x = Per_Capita_Income, y = Market_Potential, z = Total_Pop)) + geom_point() +
##  geom_text(aes(label=a$Identifier),hjust=0, vjust=0)

plot_ly(x = a$Per_Capita_Income,y=a$Market_Potential,z=a$Total_Pop, type = "scatter3d", mode ="markers")

Median of Income, Market Potential and Total Population

median(a$Per_Capita_Income) ## 32572.5
## [1] 32572.5
median(a$Market_Potential) ## 99
## [1] 99
median(a$Total_Pop) ## 47624.5
## [1] 47624.5

Kmeans Clustering

(97.6% of Variance is accounted for)

set.seed(188)
z <- kmeans(a[,-1],30)

final_withClusters <- cbind(a, clusternum = z$cluster)

z
## K-means clustering with 30 clusters of sizes 3, 6, 6, 7, 4, 7, 5, 7, 5, 6, 10, 7, 8, 5, 12, 10, 6, 3, 8, 4, 3, 12, 10, 6, 6, 5, 7, 3, 4, 3
## 
## Cluster means:
##    Market_Potential  Total_Pop Per_Capita_Income
## 1          99.33333  82640.667          52083.00
## 2         101.16667  92959.667          25556.33
## 3         105.66667  98042.333          18284.00
## 4          85.42857  15739.143          85310.71
## 5         103.00000  58211.750          48083.75
## 6         104.57143  40161.286          16704.43
## 7          94.80000  61972.000          31562.60
## 8         104.28571  69453.143          19557.86
## 9          94.40000  73377.800          70627.00
## 10         88.83333  41743.667          83505.67
## 11        106.10000 112042.500          22255.60
## 12         95.85714 111038.143          48175.71
## 13        107.75000  82262.875          20234.88
## 14         94.00000  21839.400          36242.80
## 15        100.25000  14830.083          24343.92
## 16         93.00000  37065.500          45546.00
## 17         84.66667   6545.833          71528.50
## 18         95.33333  61960.667          13214.67
## 19        102.50000 159558.500          22220.25
## 20        101.75000  68287.000          40404.00
## 21         97.33333  54175.000          19695.67
## 22         98.83333  23190.500          16374.17
## 23        104.30000   7302.500          41404.00
## 24         95.00000  20831.333          59343.67
## 25        103.66667  84802.000          33715.00
## 26         85.00000   9954.400         108455.00
## 27        114.85714   3535.000          22649.57
## 28         87.33333  47593.333          31639.00
## 29         88.75000  49801.500          40204.00
## 30         96.33333  97108.667          66463.67
## 
## Clustering vector:
##   [1] 24 25  5 15 23 21 13  6  6 13 10 17 12  4  2 29 16 15  3 28 22 16  5
##  [24] 11 14 11 24  7 12  2 29 15  2  4 26 18 27 11 27 11 13 26 13 10  4  2
##  [47] 29 22 12  9 19 20 17  6 30 11 29 19 19 19  3 20 12  6 11 25  9 20 11
##  [70] 19 19  2  7 13 25 25 10 16  3 30  9  9 11  5 13 19 12 25  8  2  6 14
##  [93] 16  1  3 19 13  8  4 10 22 16  8  7 11  3  7 26 21  5  1  8 13  8 10
## [116]  9 26  4 21 16 22 28  4 15 30 17 23 22  3 24 16 20  1 27 16 11 10 17
## [139] 25 12 12 23 23 23 16 23  7 15 22 16 15 27 27 23  8 18 22 14 15 18 15
## [162] 24 28 24 15 22 23 15 17 26 27 23 15 14 22 23 17  8 24 15  4 22 22  6
## [185] 14 27 22  6
## 
## Within cluster sum of squares by cluster:
##  [1]   34356773  105771689   88597455  314184114  127833336  159760433
##  [7]   59143136  181715591  435839538 1054398522  542853822  743250681
## [13]  158926527   45791602  318211556  426898065  137983676   33821294
## [19] 2999979102   61529921   48926147  305229964  468380699  238906699
## [25]   69723267  482848489  161167539   65683793   49915474  158051894
##  (between_SS / total_SS =  97.6 %)
## 
## Available components:
## 
## [1] "cluster"      "centers"      "totss"        "withinss"    
## [5] "tot.withinss" "betweenss"    "size"         "iter"        
## [9] "ifault"

Find groups above the Median in Income, Market Potential and Total Population

(This becomes Tier 1)

##    Market_Potential Total_Pop Per_Capita_Income
## 1          99.33333  82640.67          52083.00
## 5         103.00000  58211.75          48083.75
## 20        101.75000  68287.00          40404.00
## 25        103.66667  84802.00          33715.00

Tiers

##                   Tier 1  Tier 2  Tier 3 Tier 4
## Per Capita Income  40925 25885.5 77736.5  23895
## Market Potential     102   100.5    85.5    101
## Total Population   81673 25954.5 17739.0 100584

Here are all of the tiers. You can see that Tier 1 is the optimal right now with the second highest Income, highest Potential, and second highest Population. Tier 2 has high potential and higher income than tier4. Tier3 has the highest Per Capita Income but low Market Potential. Tier 4 has high Market Potential but lower Income.