Friday, December 18, 2015

Graphs

Univariate graphs
Variable 1: Income per person
The first graph is skewed to the right (many countries have a low average income per person whereas a few countries have a large amount of money). The mean income is 8740, but the median is 2553, indicating that most of the countries have a lower income rather than a high income per person. However, since there are really rich countries in the list (like Monaco, with an income per person of 105147), the mean is very high. 

Variable 2: Suicide rate per 100,000 inhabitants

This graph is slightly skewed to the right, but the peak is at the second observation (6 suicides for every 100,000 inhabitants), and not in the first (up to 2 suicides per 100,000 inhabitants).  About 70% of the countries have lower suicide rates (up to 10 per 100,000), and very few have high rates. The mean is 9.64 and the median is 8.26, with a standard deviation of 6.3.

Bivariate graphs
Income per person X Suicide per 100,000 inhabitants
In the scatterplot, is possible to observe that the variables do not correlate as expected - the research question aimed to see with higher incomes are associated with higher suicide rates. Variables do not correlate. The differences are very low, as can be further explored in the graph below:

Countries were distributed in three groups, with group 1 with the lowest income per person, and group 4 with the higher income per person. The mean suicide rate in each group is very similar, with groups 2 and 4 with a mean suicide rate of about 9 per 100,000, and groups 1 and 3 with a mean suicide rate of about 10 per 100,000.

My conclusion is that average income per person does not correlate with suicide rates. 


----

BTW, this is my code, written in SAS:

LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly;
DATA new; set mydata.gapminder;
LABEL incomeperperson="Income per person"
suicideper100TH="Suicide rate among 100,000 inhabitants"
lifeexpectancy="Life expectancy"
incomegroup="Aggregated income per person"
suicidegroup="Agregated suicide rate"
lifegroup="Aggregated life expectancy";
if incomeperperson LE 744.239 then incomegroup=1; /*Less than 744 per person*/
else if incomeperperson LE 2553.496 then incomegroup=2; /*Up to 2,500 per person*/
else if incomeperperson LE 9425.326 then incomegroup=3; /*Up to 9,400 per person*/
else if incomeperperson GT 9425.326 then incomegroup=4; /*More than 9,400 per person*/
if suicideper100TH LE 5 then suicidegroup=1; /*Up to 5 suicide per 100,000*/
else if suicideper100TH LE 10 then suicidegroup=2; /*Between 5 and 10 suicide per 100,000*/
else suicidegroup=3; /*More than 10 suicides per 100,000*/
if lifeexpectancy LE 60 then lifegroup=1; /*Life expectancy under 60 years*/
else if lifeexpectancy LE 75 then lifegroup=2; /*Life expectancy between 60 and 75 years old*/
else lifegroup=3; /*Life expectancy over 75 years*/
PROC SORT; by COUNTRY;
PROC FREQ; TABLES incomeperperson suicideper100TH lifeexpectancy incomegroup suicidegroup lifegroup;
PROC PRINT; var incomegroup suicidegroup lifegroup;
PROC Univariate; var incomeperperson suicideper100TH;
PROC GCHART; VBar incomeperperson/ type=pct width=30;
PROC GCHART; VBar suicideper100TH/ type=pct width=15;
proc gplot; plot suicideper100TH*incomegroup;
PROC GPLOT; PLOT lifeexpectancy*incomeperperson;
PROC GPLOT; PLOT lifeexpectancy*suicideper100TH;
proc gchart; vbar incomegroup/discrete type=mean SUMVAR=suicideper100TH;
RUN; 

Friday, December 11, 2015

Improving the program

1) This is my program, created using SAS:

LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly;DATA new; set mydata.gapminder;LABEL incomeperperson="Income per person" suicideper100TH="Suicide rate among 100,000 inhabitants" lifeexpectancy="Life expectancy" incomegroup="Aggregated income per person" suicidegroup="Agregated suicide rate" lifegroup="Aggregated life expectancy";if incomeperperson LE 1000.000000 then incomegroup=1; /*Less than 1,000 per person*/else if incomeperperson LE 5000.00000 then incomegroup=2; /*Between 1,000 and 5,000 per person*/else incomegroup=3; /*More than 5,000 per person*/if suicideper100TH LE 5 then suicidegroup=1; /*Up to 5 suicide per 100,000*/else if suicideper100TH LE 10 then suicidegroup=2; /*Between 5 and 10 suicide per 100,000*/else suicidegroup=3; /*More than 10 suicides per 100,000*/if lifeexpectancy LE 60 then lifegroup=1; /*Life expectancy under 60 years*/else if lifeexpectancy LE 75 then lifegroup=2; /*Life expectancy between 60 and 75 years old*/else lifegroup=3; /*Life expectancy over 75 years*/PROC SORT; by COUNTRY;PROC FREQ; TABLES incomeperperson suicideper100TH lifeexpectancy incomegroup suicidegroup lifegroup; PROC PRINT; var incomegroup suicidegroup life group;

2) This is the output: frequency tables in PDF

3) From the last week to this week, here is what I did: I added a third variable (life expectancy), and then grouped all variables. Now, instead of a big list of numbers, results are also aggregated into 3 groups (1 low / 2 medium / 3 high) regarding income per person, suicide rate and life expectancy. 
The dataset already accounts for missing data, so I didn't have to change that. 
I still have to analyze data further, but in general, only the obvious variables of income per person X life expectancy seem to correlate. Since my research question is related to suicide rate in rich countries, I still have to find more connections among the variables.

Saturday, December 5, 2015

My first program

1) This is my first program:

LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly;
DATA new; set mydata.gapminder;
LABEL incomeperperson="Income per person"
suicideper100TH="Suicide rate among 100,000 inhabitants";
PROC SORT; by COUNTRY;
PROC FREQ; TABLES incomeperperson suicideper100TH; 
RUN; 
2) These are the frequency tables: PDF link

3) Results are a little mixed. Even though some rich countries have high suicide rates, there are poor countries with high suicide rates as well. 
But since the purpose of this exercise was to analyze the frequency distribution of variables, for now it is sufficient to say that about half of the countries has a suicide rate of 7 or less (per 100,000 inhabitants), while the other half has a suicide rate of 8 to up to 35, so there are clear differences in this variable among countries. 
Income per person also varies, with half of the countries with an income per person of 2,000 or less, and the other half with incomes of up to 105,147. 
There is a total of 213 countries in the data set. Results from 23 countries are missing the in the income per person variable, and for 22 countries in the suicide rate. (But they are not the same countries, though - most of them have at least one of these two variables). 
I chose to work with 2 variables, instead of 3, so that's why there is no third variable in the program.

Next steps: I'll try to subset the data in order to get only countries from specific regions of the world - something like "Europe X Africa", so it would be easier to work with the data, and results might pop out more clearly.

Monday, November 30, 2015

Choosing a research question

1) After analyzing the 5 available data sets, I decided to work with Gapminder.

2) The topic that I chose to work with was suicide.

3) Codebook is created (see below)

4) The second variable I will try to related to suicide is income per person.

5) My central question would be: How suicide rates relate to income per person?

6) Literature review:
I searched for "suicide" + "personal income" at Google Scholar. These are the main results: 
SOCIAL PSYCHOLOGICAL VS SOCIOECONOMIC HYPOTHESES ON THE EPIDEMIOLOGY OF SUICIDE: AN EMPIRICAL STUDY: http://www.amsciepub.com/doi/pdf/10.2466/pr0.1996.79.3.707
How will the financial crisis affect health? http://www.bmj.com/content/338/bmj.b1314.full

In general, these studies suggest that people in depts / with financial problems are more likely to commit suicide than those with high income.

7) My hypothesis will be that a larger average income is associated with a higher suicide rate (even though the literature review might suggest the opposite).

Simplified Codebook: 

Variable name: incomeperperson
Description of indicator: 2010 Gross Domestic Product per capita in constant 2000 US$. The inflation but not the differences in the cost of living between countries has been taken into account
Main source: World Bank Work Development Indicators

Variable name: suicideper100TH
Description of indicator: 2005 Suicide, age adjusted, per 100 000 
Mortality due to self-inflicted injury, per 100 000 standard population, age adjusted
Main source: Combination of time series from WHO Violence and Injury Prevention (VIP) and data from WHO Global Burden of Disease 2002 and 2004


New blog

I'm a little late, but I'm trying to catch up. Right now, I'm watching week 1 videos and choosing the data set I will use. I should have done this by yesterday, though.