Creating Scatter Diagrams And Correlation Matrix Using Stata
Construct a scatterplot, in stata, that shows the relationship between
Economic growth and Gross capital formation (% of GDP) (A measure of Investment) Economic growth and General government final consumption expenditure (% of GDP) Economic growth and Trade (% of GDP) Economic growth and Inflation, consumer prices (annual %) Economic growth and Foreign direct investment, net inflows (% of GDP) Economic growth and Population, total Economic growth and Total natural resources rents (% of GDP)
ASSIGNMENT 7 C – MERGING DATA FILES IN STATA
Download the world development data covering the years 2000-2016 from the website
“http://databank.worldbank.org/data/reports.aspx?source=World-Governance-Indicators” for the
following upper-middle-income countries.
Countries of Interest:
Albania Ecuador Montenegro
Algeria Equatorial Guinea Namibia
American Samoa Fiji Nauru
Argentina Gabon Panama
Azerbaijan Grenada Paraguay
Belarus Guyana Peru
Belize Iran, Islamic Rep. Romania
Bosnia and Herzegovina Iraq Russian Federation
Botswana Jamaica Samoa
Brazil Kazakhstan Serbia
Bulgaria Lebanon South Africa
China Libya St. Lucia
Colombia Macedonia, FYR St. Vincent and the Grenadines
Costa Rica Malaysia Suriname
Croatia Maldives Thailand
Cuba Marshall Islands Tonga
Dominica Mauritius Turkey
Dominican Republic Mexico Turkmenistan Tuvalu Venezuela, RB
Variables of Interest
Control of Corruption: Estimate
Government Effectiveness: Estimate
Political Stability and Absence of Violence/Terrorism:
Estimate
Regulatory Quality: Estimate
Rule of Law: Estimate
Voice and Accountability: Estimate
2
STEP 1 - Download the data from the World-Governance-Indicators database as shown below
STEP 2 - Check the variables of interest
3
Please make sure you are checking the variables with “Estimates”.
TO VIEW THE DEFINITIONS OF THE VARIABLES
4
Step 3 – Select countries of interest
5
Step 4 – Click on “Time” and select the “year range” you are interested in (2000-2016)
6
Step 5 – Click on the “Layout” as shown below
Change the time layout to “Row,” series to “Column” and Country to “Row.”
Next, click on the “apply changes.”
Step 6 – Click on the “Download option” and select “Excel” as shown below
7
STEP 7: Using Excel, Replace the Missing Values With “.” (See previous assignments)
STEP 8: SAVE THE EXCEL DATA FILE ON YOUR COMPUTER PREFERABLY IN A
FOLDER
STEP 9: IMPORT YOUR DATA INTO STATA AND NAME YOUR DATA SET
“WORLD_GOVERNANCE_INDICATORS.” (See previous assignments for steps)
8
STEP 10; RENAME THE VARIABLES AS SHOWN BELOW (See previous assignments for
steps)
Using stata, merge the data set from “ASSIGNMENT 3B” with this dataset
VERY IMPORTANT Note: Merging two datasets requires that both have at least one variable in
common (either string or numeric).
This statement requires that the variable name for “Time” and “Country” should be the same in the two
data set
MERGING THE DATASET FROM “ASSIGNMENT 3” WITH THE DATA FROM THE
WORLD GOVERNANCE INDICATORS
Merging data files in stata
https://www.youtube.com/watch?v=EV-5PztbHs0
https://www.youtube.com/watch?v=Uh7C0mlhB3g&t=54s
https://www.youtube.com/watch?v=2etG_34ODoc
I will strongly encourage you to watch these videos before merging
I will also strongly recommend you read the notes in the link below before you start
merging
https://www.princeton.edu/~otorres/Merge101.pdf
Original Variable Name After Renaming
Control of Corruption: Estimate Corruption
Government Effectiveness: Estimate Gov't_Effectiveness
Political Stability and Absence of Violence/Terrorism: Estimate Political_Stability
Regulatory Quality: Estimate Reg't_Quality
Rule of Law: Estimate Rule_of_Law
Voice and Accountability: Estimate Voice_Accountability
https://www.youtube.com/watch?v=EV-5PztbHs0
https://www.youtube.com/watch?v=Uh7C0mlhB3g&t=54s
https://www.youtube.com/watch?v=2etG_34ODoc
https://www.princeton.edu/~otorres/Merge101.pdf
9
STEP 1 – Open “Assignment 3” dataset in Stata as shown below
10
Remember, the way you have named “Time” and “Country” in Assignment 3 B should be
the same as you have in the “World Governance Indicators”
STEP 2 – Merge “Assignment 3” dataset with the one from the World Governance Indicators
11
Note: Very Important
Key variables; Time Country_id
The key variables must be the same in the two datasets regarding naming.
If “Time” and “Country_id” are named differently in the two dataset, your data will not
merge
12
STEP 3 – Save your new data set and send it to me via blackboard
Answer Format
1. Send me your new data file via blackboard