Thursday, September 22, 2016

Which is the smartest county in Ireland? #Analytics #HDSDA #101

If the percentage of people in an area who hold a Ph.D. is a measure of how smart a county is, then look no further than the 2011 Census Small Area Population Statistics (SAPS) for details. I downloaded the figures for the overall population of each county, and the numbers of men and women in each county who hold a Ph.D. Of course counties with larger populations will have more Ph.Ds. (Co Dublin had a population of 910,012 of whom 6,573 had a Ph.D. in 2011). So I converted the figures to a percentage in order to make comparisons between the counties. 

The bar chart below (written in R) displays the percentage of the population of each of the 26 counties who have a Ph.D.


While the numbers are small, 0.72% of the population of Dublin (where there are three Universities) has a Ph.D., it is interesting to compare the regions and counties. You can see that the University cities (Dublin, Galway, Cork, and Limerick), plus their surrounding counties (e.g. Wicklow, Kildare, Clare), have much higher levels than midland counties where there is no university. It is also reasonable to assume that where there are Universities, there will be more people with Ph.D. living there because that's where many of them work. I'll do a comparison of males and females for tomorrow.

If you would like to plot this chart for yourself, the R code at the end of this post should work. You'll need to create a CSV file to store the data (I called mine "PhDbyCounty.csv" in the code below) - here's a table of the data I used that you should copy and save into the CSV file:

County Males PhD Female PhD Total PhD Pop Males Pop Females Total Pop (over 19+) Percentage Males Percentage Females Percentage Total
Dublin 4,174 2,399 6,573 440,432 469,580 910,012 0.95 0.51 0.72
Galway 710 416 1,126 86,221 86,569 172,790 0.82 0.48 0.65
Cork 1,333 722 2,055 177,896 180,378 358,274 0.75 0.4 0.57
Carlow 48 42 200 18,730 18,210 36,940 0.26 0.23 0.54
Wicklow 284 155 439 45,376 46,665 92,041 0.63 0.33 0.48
Kildare 397 219 616 67,046 66,361 133,407 0.59 0.33 0.46
Limerick 372 194 566 68,797 68,663 137,460 0.54 0.28 0.41
Clare 183 109 292 40,819 40,170 80,989 0.45 0.27 0.36
Meath 245 145 390 58,561 57,609 116,170 0.42 0.25 0.34
Sligo 79 64 143 22,330 23,055 45,385 0.35 0.28 0.32
Waterford 150 76 226 39,397 40,103 79,500 0.38 0.19 0.28
Westmeath 94 62 156 28,521 28,648 57,169 0.33 0.22 0.27
Kerry 183 69 252 52,962 52,206 105,168 0.35 0.13 0.24
Leitrim 29 18 47 11,052 10,442 21,494 0.26 0.17 0.22
Tipperary 149 93 242 55,296 54,064 109,360 0.27 0.17 0.22
Mayo  117 75 192 46,001 45,096 91,097 0.25 0.17 0.21
Cavan 37 19 90 23,752 22,343 46,095 0.16 0.09 0.2
Louth 106 58 164 39,721 40,841 80,562 0.27 0.14 0.2
Donegal 133 67 200 52,113 52,725 104,838 0.26 0.13 0.19
Longford 30 17 47 12,734 12,263 24,997 0.24 0.14 0.19
Wexford 111 72 183 47,473 47,761 95,234 0.23 0.15 0.19
Roscommon 47 33 80 22,385 21,158 43,543 0.21 0.16 0.18
Kilkenny 57 43 100 31,915 31,453 63,368 0.18 0.14 0.16
Offaly 39 39 78 25,581 25,113 50,694 0.15 0.16 0.15
Laoighis 37 24 61 24,773 23,428 48,201 0.15 0.1 0.13
Monaghan 17 21 38 20,717 19,983 40,700 0.08 0.11 0.09


# R code to plot bar chart
#
# read in and display PhD data from CSV file
PhDdata <- hdbycounty.csv="" header="T)</font" read.csv="" sep=",">
#
# Check input is read correctly: display some data from CSV file
names (PhDdata)
PhDdata$County
PhDdata$Percentage.Total
#
# Plot bar chart
barplot(PhDdata$Percentage.Total, horiz = TRUE, 
        names.arg = PhDdata$County, xlab = "Percent Population with a PhD",
        main = "Proportion of PhD by County in Republic of Ireland",
       col = "red", space=0.5, axisnames=TRUE, cex.names = 0.75, las=1)
# end of code

No comments:

Post a comment