STATA program homework

profiledlwsdu
note_googledoc.docx

QUESTIONS:

Question 1

a) Calculate the average level of real per capita income in 1975 and in 2009 for the

countries in the region of Asia.

b) Report the minimum, average and maximum per capita income.

summarize

c) Plot and report histograms of income for 1975 and 2009.

histogram rgpch1975 if Asia==1, freq?

Frequency is a better way to read the graph.

histogram rgpch2009 if Asia==1, freq

d) What do the distributions look like and how has the distribution of income changed over this time period?

· Should the command be histogram rgpch1975 if Asia==1, freq

· Also, how would you interpret the new numbers though? The distributions are both skewed to the right and the distribution of income has not relatively changed between 1975 and 2009 in the region of Asia.-- My interpretation… am I right?

>Question: should we log the histograms? or leave it as is

> I also have the same question. Since the histogram is skewed I think we have to log it. However, the new numbers are single and should we have a histogram of income for 1975 and 2009 only or 1975 and 2009 for the countries in the region of Asia?

My TA responded and she said that she will ask the professor on the ambiguity of the question.

My TA has replied and we have to produce a histogram for of income for 1975 and 2009 for the countries in the region of Asia.

Does anyone know how to interpret the new graph of the histogram after logging (because it was skewed) and adding freq to get rid of the concentration of density. In other words, how would you interpret the trend on the X and Y axis of the new graph ( are the numbers in percentage)?

· changing to frequency is pretty easy. all you have to do is histogram rgpdch1975, freq and if you want to change the bin sizes (10 is best) then type out histogram rgpdch1975, freq bin (10)

·

· rgpch1975 is not taking into account only countries in Asia. Should the command be histogram rgpch1975 if Asia==1, freq? Also, how would you interpret the new numbers though?

· how would you interpret the trend on the X and Y axis of the new graph ( are the numbers in percentage)?

I emailed the TA and he said that we don’t need to log it for question 1 graph.

Question 2

a) Generate a new variable measuring the growth rate of real per capita income over the

time period 1975 to 2009 for each country in the dataset. (Hint: the growth rate is the

change in value divided by the original value.)

gen growthrate75to09=(rgdpch2009-rgdpch1975)/(rgdpch1975)

label variable growthrate75to09 “Growth Rate 75to09”

b) Use the list command to list the growth rates by country and to look at the data (you do not need to report the list in your writeup).

list country growthrate75to09

c) Next, report the minimum, average, and maximum growth rate for the countries in

the data set, and show a hitstogram of the growh rates.

summarize Country growthrate75to09

histogram Country growthrate75to09 (DOES THIS WORK?) Yes

d) Report the minimum, average, and maximum growth rates for countries in Asia and in Africa.

summarize growthrate75to09 if Asia==1

summarize growthrate75to09 if Africa==1

e) What does the distribution of growth rates demonstrate?

f) Do most countries grow at about the same rate?

g) What are the fastest and the slowest growing countries in the African dataset?

h) Is the difference in the growth rates in African countries about the same as the difference

between the fastest and slowest growing counties elsewhere in the world?

the command ‘summarize’ shows the average, min and max values;

Yes, but a new variable needs to be created for growth rate.

>would gen growthrate75to09=(rgdpch2009-rgdpch1975)/(rgdpch1975)

list Country growthrate75to09

summarize growthrate75to09

be correct?

Question 3

a) Produce box plots of the GDP per capita for the countries in the regions of Asia and Africa in 1975.

graph box rgdpch1975 if africa==1

graph box rgdpch1975 if asia==1

b) Discuss what you see in the plots.

c) Now produce a log transformation of the measure of 1975 GDP.

Log transformation

gen log75=log(rgdpch1975)

e) Plot four box plots side-by-side, one for each region with and without the logged value of GDP. 1. Need to generate new variable:

gen africagdp1975=rgdpch1975 if Africa==1

label variable africagdp1975 “GDP Africa 1975”

gen asiagdp1975=rgdpch1975 if Asia==1

label variable asiagdp1975 “GDP Asia 1975”

graph box africagdp1975 asiagdp1975, title(“Comparison of Africa and Asia GDP 1975)

f) Explain why the plots that use logged values differ from the plots that do not.

g) Provide an interpretation of the difference in GDP per capita between Asian and African countries in 1975.

graph box rgdpch1975 if africa==1

graph box rgdpch1975 if asia==1

Log transformation

gen log75=log(rgdpch1975)

Question 4

a) Take the maximum growth rate for an African country that you calculated in Question 2 and apply it to the poorest African country in 1975. liberia and ecuedor guinea

poor

b) Then take the minimum growth rate for an African country that you calculated in Question 2 and apply it to the richest African country in 1975.

c) How would these different growth rates affect the level of income of these countries as of 2009?

d) Explain your calculations. [Hint: reverse the calculation you made in Question 2 to solve for GDPPC 2009.]

e) What do your results imply about the importance of long-run growth?

I used the formula : A=P(1+r/n)^nt. A is the outcome, P is the principal (starting) value, r is the rate, n is the number of times per year that interest is accrued, and t is the duration of growth.

>If anyone could verify if this formula works for countries with negative growth rates, that would be really great

is there any way you can show how you would add this on the do file so I can help?

>so i made a list of 1975 values’ real GDP alone by using the command generate realGDP1975=rgdpch1975*pop75

and then sort realGDP1975

followed by list Country realgdp1975 if africa==1

Afterwards, the poorest country i have from the above commands was Saotome and Principe(?) with a real GDP 1975 of 1x10^8 dollars.

to use the formula above, i get: real gdp s&p = ((1x10^8) x ((1+18.23^34))=4.5216x10^51 *n=1

would this be correct? ty.

Can anyone else also confirm this. I am having difficulty with this question.

The poorest country I have is Burundi, can anyone check this?

Question 5

a) Sort the country data for all countries in the world by the growth rates you calculated in Question 2.

sort growthrate75to09

list growthrate75to09

b) Identify and report the 10 fastest growing and the 10 slowest growing countries in the dataset.

c) What do you see in common among the fast growers?

d) What about the slow growers?

e) Do you notice anything about the geography of the fast growers compared with the slow-growers?

To identify the 10 fastest and 10 slowest does anyone know a faster way to add the command? I know you can use L for last on the list.

for slowest ones

sort growthrate75to09

list Country growthrate75to09 in 1/10

for fastest ones

sort growthrate75to09

drop if missing(growthrate75to09)

list country growthrate75to09 in -10/L

-10/L brings up the last ten countries but these countries do not have data. Does that mean we need to go with the ten right above them who have numbers? which would look like list country growthrate75to09 in -45/-35. It very well could be this way because it computes 10 countries in Asia and Southeast Asia and from other classes I have learned those zones have the fastest growing economies.

this one wouldn’t work if you try to get the fastest growing ones, it would give you the ones with missing data. Thanks!