MOTOR VEHICLES AND DIVORCES IN TURKEY

Last year, exactly on this date, I posted an article about women on this site ( https://lassietecolinas.wordpress.com/2015/03/08/on-women-on-a-womens-day/ ). Today I have decided to look at things from a somewhat light-hearted point of view. Even though women’s plight in the world has not changed since last year, and that it may even be worse, I do not feel like dramatizing things, so let’s keep on reading..

As it would be expected in any developing economy, the number of motor vehicles in Turkey has been steadily increasing. The Statistical Institute of Turkey reports that the numbers went up from 8,521,956 in 2001 to 19,994,472 in 2015. This is not only due to the expansion of the economy, but also because of the increase in the population, which, according to the World Bank, grew from about 64 million in 2001 to almost 76 million in 2014. The number of divorces also increased, parallel to the population increase during this period. In the face of such sharp increase in numbers, and out of curiosity, one might very well be interested in looking into this. The following plot displays what is explained above. The correlation coefficient r = 0.9359 as calculated by R, is highly impressive. However, let’s face it, despite the rationale one might think of regarding the increase in individual variables and their covariation, this is one of those cases of spuriousness.

Motor vehicles and Divorces in Turkey (2001-2015)
Motor vehicles and Divorces in Turkey (2001-2015)

It should be obvious to anyone with a minimal understanding of socioeconomic phenomena and statistics, that it just does not make any sense to think of divorces somehow being linked to the number of motor vehicles. One cannot possibly cause the other, so we will have to think of confounding factors (variables in technical lingo) such as development of economy, emancipation of women, economic crises causing unresolvable disputes between spouses, etc. that actually play a role in the background, affecting our variables of interest. As this exercise illustrates, one can find a relationship and calculate a correlation coefficient between almost any two variables (factors or phenomena in ordinary language) in life. However, the question is whether or not that seeming relationship will be meaningful.

Briefly, the moral of the story for the newly initiated is that looks can be deceptive, we would be well advised to delve into the matter and look for hidden factors.

Advertisements

The Human Development Index (HDI)

The Index is generally viewed numerically, and countries are compared on the basis of their numeric distance from each other (UNDP Data ). While this is usually sufficient to get an idea about the differential levels of development, one might also be interested in a visual inspection of the data. Here’s a nifty study on the HDI of the United nations: Clusters in the Human Development Index

As I have indicated in a previous post, cluster analysis comes in handy in many situations where categorical differences are of interest.

The Rising Tide of R

I do not know to what extent R, the Statistical Computing Environment,  is being used in the social science community (or by fellow political scientists for that matter) but in a variety of disciplines R is becoming the tool for data analysis.  Despite the fact that it has a steep learning curve, it is certainly worth diving into.  It is a very powerful language, and as such it poses a real challenge to the commercially available software such as SPSS or SAS.  Although commercial software has its own advantages, R is superior in many ways.  Not only is it freely available, it also has a wide and growing community of users that keep adding to its arsenal.  Even though a user doesn’t need all the features R offers, it has something for everyone who deals with data.  The magazine Nature has published an article that should give you a good idea about R.  Click on the following link to read it: http://www.nature.com/news/programming-tools-adventures-with-r-1.16609

 

A Brief Analysis of the TBMM

The last general elections in Turkey were held on June 12, 2011. The 24th Congress of the Grand National Assembly of Turkey (TBMM) had 536 parliamentarians in October 2014. Here I provide, for instructional purposes, a simple and descriptive study of the representatives, using R. I owe thanks to Sercan Pekel for helping me put together the data.

First, we have to get the data into R. The data reside in a csv file. Storing data in a spreadsheet is quite convenient, and is perhaps more recommendable for the inexperienced student because working with a text file initially may be rather error-prone.

tbmm  <- read.csv("TBMM.csv", header = T, sep = ",")

After reading the data into R, we might want to see the structure thereof. For this we can issue the command str():

str(tbmm)
## 'data.frame':    536 obs. of  5 variables:
##  $ Name      : Factor w/ 534 levels "ABDÜLKADIR AKSU",..: 345 397 307 39 498 316 170 42 46 410 ...
##  $ Birthdate : int  1952 1968 1943 1965 1962 1976 1966 1954 1948 1941 ...
##  $ Sex       : Factor w/ 2 levels "M","W": 1 1 1 1 1 1 2 1 1 1 ...
##  $ Profession: Factor w/ 45 levels "","ACADEMICIAN",..: 29 38 11 12 27 29 29 12 11 17 ...
##  $ Lang      : int  1 1 3 1 1 2 1 1 1 2 ...

R tells us it is a data frame with 5 variables. Name is a factor variable, so are Sex and Profession. Birthdate and Lang (languages spoken by the deputies), on the other hand, are integers.

Given this data set, we might, for example, be interested in the age distribution of the deputies. This can be calculated by finding the difference between 2014 and their year of birth. In R, assigning calculated values to a vector is very practical because it allows the analyst to use those values without having to re-compute them.

age <- 2014 - tbmm$Birthdate  # Calculate their ages

Getting the summary statistics is easy enough:

summary(age)  # Compute descriptive statistics for age
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   30.00   47.00   53.00   53.16   59.00   80.00

The average age is 53 years. That the mean and the median are very close to each other is an indication of a nearly normal distribution. Now that we have “age” as a vector, we can visualize the age distribution of the deputies:

hist(age, col = "green", main = "The Ages of Parliamentarians",
     xlab = "Age")  # Histogram with frequencies

 

The Ages of Parliamentarians
The Ages of Parliamentarians

 

The histogram indicates quite a nice, nearly normal distribution. Just in case we might be interested in the densities, we have to create the histogram with a slight change in the code:

Density Plot of the Ages of the Parliamentarians
Density Plot of the Ages of the Parliamentarians
hist(age, col = "green", main = "The Ages of Parliamentarians", freq = F, xlab = "Age")
lines(density(age), col = "red", lwd = 3)  # Fit a density curve to the histogram

 

The argument freq=F creates a histogram with densities rather than frequencies. The density() command adds a density line to the histogram, as seen above.

Although the histogram is quite revealing, one can also check normality by producing a quantile-quantile plot. If one wanted to add a line to the normality plot, the qqline() command would get the job done:

qqnorm(age)  # Checking for normality
qqline(age)  # Add a theoretical distribution line

 

Q-Q Plot
Q-Q Plot

The distribution of the ages is not bad. However, if we wanted to check the normality of the variable numerically, then we would load the “e1071” (assuming that it is already installed) package and use the skewness() command.

library(e1071)
skewness(age)
## [1] 0.1714109

Now let’s create a new data frame by including the age vector, and call it tbmm2:

tbmm2 <- data.frame(tbmm, age)  # Create a data frame with the new var, age

After forming a new data frame, we can now look at some other characteristics of the members of parliament:

agebysex_w <- subset(table(age, tbmm2$Sex), tbmm$Sex == "W")
agebysex_m <- subset(table(age, tbmm2$Sex), tbmm$Sex == "M")

We have just created two subsets of the data, one for women and another for men. There are 75 female and 461 male members of parliament. Next, we can examine the age distribution of the female representatives:

hist(agebysex_w, col = "pink")  # Ages of female representatives

 

Ages of Female Deputies
Ages of Female Deputies

A similar histogram for the males can be produced using the same syntax:

hist(agebysex_m, col = "blue")  #  Ages of male representatives

 

Ages of Male Deputies
Ages of Male Deputies

Now we have a pretty good idea about their ages, and if we think we might do some further work on the males and the females, we might want to create some subsets for the respective categories:

list_w <- subset(tbmm2, Sex == "W")  # Create a list of female reps
list_m <- subset(tbmm2, Sex == "M")  # Create a list of male reps

Just out of curiosity, one might wonder who the female representatives are. For this, it is enough to type the name of the newly created vector, list_w:

list_w
##                       Name Birthdate Sex    Profession Lang age
## 7             FATOŞ GÜRKAN      1966   W        LAWYER    1  48
## 27            FATMA SALMAN      1970   W    ACCOUNTANT    0  44
## 31           İLKNUR İNCEÖZ      1973   W        LAWYER    1  41
## 39    AYŞE GÜLSÜN BİLGEHAN      1957   W   ACADEMICIAN    2  57
## 48             ÜLKER GÜZEL      1944   W       PLANNER    1  70
## 56          AYLİN NAZLIAKA      1968   W BUSINESSWOMAN    1  46
## 58         TÜLAY SELAMOĞLU      1966   W     ARCHITECT    2  48
## 61            NURDAN ŞANLI      1954   W BUSINESSWOMAN    1  60
## 62      EMİNE ÜLKER TARHAN      1963   W         JUDGE    1  51
## 63             ZUHAL TOPÇU      1960   W   ACADEMICIAN    1  54
## 75      GÖKCEN ÖZDOĞAN ENÇ      1976   W    SPECIALIST    1  38
## 87             SEMİHA ÖYÜŞ      1960   W        LAWYER    1  54
## 90       AYŞE NEDRET AKOVA      1948   W        LAWYER    1  66
## 92           TÜLAY BABUŞCU      1976   W    PHARMACIST    1  38
## 121   CANAN CANDEMİR ÇELİK      1974   W        LAWYER    1  40
## 126       TÜLİN ERKAL KARA      1969   W    TRANSLATOR    2  45
## 127            SENA KALELİ      1956   W BUSINESSWOMAN    2  58
## 148        NURCAN DALBUDAK      1979   W    TECHNICIAN    1  35
## 153         NURSEL AYDOĞAN      1958   W      ENGINEER    1  56
## 154             EMİNE AYNA      1968   W                  1  46
## 157             OYA ERONAT      1962   W      ENGINEER    1  52
## 160         MİNE LÖK BEYAZ      1973   W     ARCHITECT    1  41
## 162             LEYLA ZANA      1961   W    JOURNALIST    1  53
## 169           SERMİN BALIK      1972   W BUSINESSWOMAN    1  42
## 177   FAZİLET DAĞCI ÇIĞLIK      1973   W      ENGINEER    4  41
## 183              ÜLKER CAN      1963   W    PHARMACIST    1  51
## 184         RUHSAR DEMİREL      1963   W        DOCTOR    1  51
## 186           DERYA BAKBAK      1972   W     ARCHITECT    1  42
## 216          PERVİN BULDAN      1967   W                  1  47
## 223        SABAHAT AKKİRAY      1955   W        ARTIST    1  59
## 225          MERAL AKŞENER      1956   W   ACADEMICIAN    0  58
## 230   AYŞE NUR BAHÇEKAPILI      1954   W        LAWYER    1  60
## 233              NİMET BAŞ      1965   W        LAWYER    1  49
## 242         TÜRKAN DAĞOĞLU      1945   W        DOCTOR    1  69
## 243           GÜLAY DALYAN      1962   W      ENGINEER    1  52
## 244    AYŞE ESER DANIŞOĞLU      1962   W   ACADEMICIAN    2  52
## 245           ALEV DEDEGİL      1958   W ADMINISTRATOR    1  56
## 257        HALİDE İNCEKARA      1959   W ADMINISTRATOR    1  55
## 262         TÜLAY KAYNARCA      1969   W    JOURNALIST    0  45
## 268            SEDEF KÜÇÜK      1958   W ADMINISTRATOR    2  56
## 273             MELDA ONUR      1964   W    JOURNALIST    3  50
## 280            ŞAFAK PAVEY      1976   W      DIPLOMAT    7  38
## 284   MİHRİMAH BELMA SATIR      1961   W        LAWYER    1  53
## 285          SEVİM SAVAŞER      1953   W   ACADEMICIAN    1  61
## 286       FATMA NUR SERTER      1948   W   ACADEMICIAN    1  66
## 289      BİHLUN TAMAYLIGİL      1966   W     ECONOMIST    2  48
## 293          BİNNAZ TOPRAK      1942   W   ACADEMICIAN    1  72
## 297         SEBAHAT TUNCEL      1975   W    TECHNICIAN    0  39
## 306     BİRGÜL AYMAN GÜLER      1961   W   ACADEMICIAN    1  53
## 311         İLKNUR DENİZLİ      1964   W      ENGINEER    1  50
## 313            HÜLYA GÜVEN      1951   W        DOCTOR    1  63
## 317    ŞÜKRAN GÜLDAL MUMCU      1951   W BUSINESSWOMAN    1  63
## 330    SEVDE BAYAZIT KAÇAR      1974   W FILM PRODUCER    1  40
## 343        MÜLKİYE BİRTANE      1964   W       TEACHER    4  50
## 349     PELİN GÜNDEŞ BAKIR      1972   W   ACADEMICIAN    1  42
## 370      AZİZE SİBEL GÖNÜL      1966   W     ARCHITECT    1  48
## 385          GÜLAY SAMANCI      1977   W        LAWYER    0  37
## 387       AYŞE TÜRKMENOĞLU      1965   W        LAWYER    0  49
## 398            ÖZNUR ÇALIK      1965   W    PHARMACIST    1  49
## 407              SAKİNE ÖZ      1964   W     ARCHITECT    1  50
## 413 GÖNÜL BEKİN ŞAHKULUBEY      1970   W    PHARMACIST    2  44
## 416        GÜLSER YILDIRIM      1963   W                  0  51
## 422  ÇİĞDEM MÜNEVVER ÖKTEN      1961   W       TEACHER    2  53
## 457          AYŞENUR İSLAM      1958   W   ACADEMICIAN    1  56
## 462            TÜLAY BAKIR      1947   W        DOCTOR    2  67
## 476 MESUDE NURSUNA MEMECAN      1957   W      ENGINEER    1  57
## 491    ZEYNEP ARMAĞAN USLU      1969   W   ACADEMICIAN    1  45
## 493            SELMA IRMAK      1971   W                  1  43
## 500          ÖZLEM YEMİŞÇİ      1971   W BUSINESSWOMAN    1  43
## 501          CANDAN YÜCEER      1973   W        DOCTOR    1  41
## 506           DİLEK YÜKSEL      1977   W     ECONOMIST    1  37
## 512      SAFİYE SEYMENOĞLU      1964   W     ARCHITECT    1  50
## 515    DİLEK AKAGÜN YILMAZ      1963   W        LAWYER    1  51
## 523           GÜLŞEN ORHAN      1970   W ARCHAEOLOGIST    3  44
## 524           AYSEL TUĞLUK      1965   W        LAWYER    0  49

Just as we computed the summary statistics for all the representatives, we can compute them for males and females separately as well:

summary(list_w$age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   35.00   44.00   50.00   50.37   56.00   72.00

Similarly, for men we use the other vector:

summary(list_m$age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   30.00   47.00   54.00   53.61   59.00   80.00

It is seen that men have a slightly higher mean age than women. Earlier we have seen that the average of all the deputies is 53 years. The summary statistics also told us that the youngest is 30 years old, and the oldest 80. We might want to know who they are. Subsetting our data would give us the answer we need:

youngest  <- tbmm2[ which(tbmm2$age == 30), ]

By typing the name of the vector, youngest, we can see who he is:

youngest
##                     Name Birthdate Sex Profession Lang age
## 270 MUHAMMET BİLAL MACİT      1984   M SPECIALIST    1  30

Of course creating a new vector for the youngest individual may not be of much use. However, if we think we might want to get the name and the associated data quickly in a future analysis, this can be done by assigning that person to a vector.

The same operation can be performed for the oldest member of parliament:

oldest  <- tbmm2[ which(tbmm2$age == 80), ]
oldest
##                 Name Birthdate Sex Profession Lang age
## 249 OSMAN OKTAY EKŞİ      1934   M JOURNALIST    1  80

The oldest member of the parliament turns out to be the well-known journalist, Oktay Ekşi.

By going over the data we can see that one of the representatives speaks 10 languages. That is certainly an interesting case. However, considering that even speaking three languages is not a very common phenomenon, we might want to see how many of the deputies can speak more than three languages:

tbmm2[ which(tbmm2$Lang > 3), ]
##                            Name Birthdate Sex  Profession Lang age
## 28          MEHMET KERİM YILDIZ      1965   M      DOCTOR    4  49
## 57          NAZMİ HALUK ÖZDALGA      1948   M    ENGINEER    4  66
## 59              SEYİT SERTÇELİK      1964   M ACADEMICIAN   10  50
## 72                 MEHMET GÜNAL      1964   M   ECONOMIST    4  50
## 73             YUSUF ZİYA İRBEÇ      1959   M   ECONOMIST    7  55
## 177        FAZİLET DAĞCI ÇIĞLIK      1973   W    ENGINEER    4  41
## 240              MUHAMMED ÇETİN      1963   M ACADEMICIAN    4  51
## 280                 ŞAFAK PAVEY      1976   W    DIPLOMAT    7  38
## 296                  FAİK TUNAY      1981   M BUSINESSMAN    5  33
## 335 YILDIRIM MEHMET RAMAZANOĞLU      1956   M      DOCTOR    5  58
## 343             MÜLKİYE BİRTANE      1964   W     TEACHER    4  50
## 376               LÜTFÜ TÜRKKAN      1959   M BUSINESSMAN    4  55
## 390                   CEM ZORLU      1963   M ACADEMICIAN    4  51
## 414                   EROL DORA      1964   M      LAWYER    4  50
## 487       MEHMET KASIM GÜLPINAR      1969   M  BUREAUCRAT    4  45
## 492          MEHMET EMİN DÜNDAR      1959   M      DOCTOR    4  55
## 519              MUSTAFA BİLİCİ      1969   M  ACCOUNTANT    4  45
## 522             BURHAN KAYATÜRK      1970   M    ENGINEER    5  44

Whoa! There is quite an impressive group of people that are polyglots. Since we do not have a chance to verify the truth of these findings, we have to accept our findings at their face value.

Since we ended up with so many people that speak a multitude of languages, we might want to put this subset in a vector so that next time we are intereted in knowing how many there are of them or who they are, we can quickly get the information we need:

polyglots  <- tbmm2[ which(tbmm2$Lang > 3), ]

We can now perform the same operation to see how many deputies speak no languages:

no_speak <- tbmm2[ which(tbmm2$Lang < 1), ]
no_speak
##                         Name Birthdate Sex    Profession Lang age
## 27              FATMA SALMAN      1970   W    ACCOUNTANT    0  44
## 53             SALİH KAPUSUZ      1954   M   BUSINESSMAN    0  60
## 74              OSMAN KAPTAN      1946   M    BUREAUCRAT    0  68
## 81          UĞUR BAYRAKTUTAN      1965   M        LAWYER    0  49
## 96     MEHMET CEMAL ÖZTAYLAN      1954   M     ECONOMIST    0  60
## 98  MUHAMMET RIZA YALÇINKAYA      1955   M      ENGINEER    0  59
## 99             AYLA AKAT ATA      1976   M        LAWYER    0  38
## 104         FAHRETTİN POYRAZ      1968   M       AUDITOR    0  46
## 105           BAHATTİN ŞEKER      1956   M   BUSINESSMAN    0  58
## 110              VAHİT KİLER      1966   M   BUSINESSMAN    0  48
## 124             KEMAL EKİNCİ      1948   M      ENGINEER    0  66
## 131                 İSMET SU      1959   M        LAWYER    0  55
## 134             TURHAN TAYAN      1943   M        LAWYER    0  71
## 144               SALİM USLU      1955   M        WORKER    0  59
## 147            İLHAN CİHANER      1968   M    PROSECUTOR    0  46
## 149             ADNAN KESKİN      1942   M        LAWYER    0  72
## 168               ŞUAY ALPAY      1960   M        LAWYER    0  54
## 174     SEBAHATTİN KARAKELLE      1950   M       TEACHER    0  64
## 188           MEHMET ERDOĞAN      1956   M   BUSINESSMAN    0  58
## 191              MEHMET SARI      1968   M   BUSINESSMAN    0  46
## 199 SELAHATTİN KARAAHMETOĞLU      1952   M    PHARMACIST    0  62
## 206              HASAN AKGÖL      1965   M    TECHNICIAN    0  49
## 207       ADNAN ŞEFİK ÇİRKİN      1962   M        FARMER    0  52
## 222               CELAL ADAN      1951   M      ENGINEER    0  63
## 225            MERAL AKŞENER      1956   W   ACADEMICIAN    0  58
## 239          SÜLEYMAN ÇELEBİ      1953   M    TECHNICIAN    0  61
## 250              EKREM ERDEM      1948   M       TEACHER    0  66
## 260               ATİLA KAYA      1957   M   BUSINESSMAN    0  57
## 261                EROL KAYA      1959   M ADMINISTRATOR    0  55
## 262           TÜLAY KAYNARCA      1969   W    JOURNALIST    0  45
## 277      SIRRI SÜREYYA ÖNDER      1962   M        ARTIST    0  52
## 297           SEBAHAT TUNCEL      1975   W    TECHNICIAN    0  39
## 300    ABDULLAH LEVENT TÜZEL      1961   M        LAWYER    0  53
## 308                 MUSA ÇAM      1953   M        WORKER    0  61
## 316          MUSTAFA MOROĞLU      1958   M   BUSINESSMAN    0  56
## 320         MEHMET ALİ SUSAM      1956   M       CHEMIST    0  58
## 321             AYDIN ŞENGÜL      1968   M  CITY PLANNER    0  46
## 334            NEVZAT PAKDİL      1950   M    BUREAUCRAT    0  64
## 340             MEVLÜT AKGÜN      1966   M        LAWYER    0  48
## 347              HAKKI KÖYLÜ      1948   M    PROSECUTOR    0  66
## 355              SADIK YAKUT      1956   M         JUDGE    0  58
## 360             TURGUT DİBEK      1966   M        LAWYER    0  48
## 369              NİHAT ERGÜN      1962   M    ACCOUNTANT    0  52
## 383              ATILLA KART      1954   M        LAWYER    0  60
## 385            GÜLAY SAMANCI      1977   W        LAWYER    0  37
## 387         AYŞE TÜRKMENOĞLU      1965   W        LAWYER    0  49
## 403             UĞUR AYDEMİR      1967   M    ACCOUNTANT    0  47
## 406               HASAN ÖREN      1953   M   BUSINESSMAN    0  61
## 410       HÜSEYİN TANRIVERDİ      1956   M       TEACHER    0  58
## 415            MUAMMER GÜLER      1949   M    BUREAUCRAT    0  65
## 416          GÜLSER YILDIRIM      1963   W                  0  51
## 420                  İSA GÖK      1963   M        LAWYER    0  51
## 447             İDRİS YILDIZ      1950   M      ENGINEER    0  64
## 454            HAYATİ YAZICI      1952   M         JUDGE    0  62
## 464            MUSTAFA DEMİR      1961   M     ARCHITECT    0  53
## 484              FARUK ÇELİK      1956   M       TEACHER    0  58
## 497             BüLENT BELEN      1956   M    ACCOUNTANT    0  58
## 507              KORAY AYDIN      1955   M      ENGINEER    0  59
## 524             AYSEL TUĞLUK      1965   W        LAWYER    0  49
## 527            MUHARREM İNCE      1964   M       TEACHER    0  50
## 534        ALİ İHSAN KÖKTÜRK      1963   M        LAWYER    0  51
## 535            KÖKSAL TOPTAN      1943   M        LAWYER    0  71

We can see that 62 representatives do not speak any languages, and 18 speak more than 3.

Now that we have examined the age distribution and the knowledge of languages in the parliament, we have some idea about the characteristics of the people that have been elected to represent the people in Turkey.

As indicated at the outset, this was a simple exercise in calculating descriptive statistics using R, and also a quick and rather superficial examination of the members of parliament in Turkey.

Before we end our session, we can save this whole work that we have done in an RData file:

save.image("tbmm.RData")

Finally, good housekeeping is always a good habit to develop:

remove(list=ls())

Note: The data can be downloaded from: https://github.com/Locomarinero/TBMM/blob/master/tbmm24.txt