SlideShare une entreprise Scribd logo
1  sur  21
DATA
Ryan Herzog, Ph.D.
Associate Professor
Gonzaga University
FINAL GROUP/INDIVIDUAL PROJECT
• Think about a relationship you’ve learned about in economics…
• CO2 Emissions and GDP growth
• International trade and growth
• Consumption and disposable income
• Economic growth and investment
• Government debt and economic growth
• Look at Our World in Data for ideas…
• Try to think about macro/international ideas. Data are much easier to find.
• There are also lots of good macro/regional data at the state level (check the U.S.
Census).
LITERATURE REVIEW
• Google scholar is your friend.
• Find at least 3 papers related to your topic. Summarize their sample,
data, methodology, and results
DATA
• Many
• We have more data than we know what to do with!
IN THIS TOPIC
• Types of data
• Cross-sectional
• Pooled
• Panel
• Data collection
• Data sources
SELECTED OBSERVATIONS ON TEST SCORES
AND OTHER VARIABLES FOR CALIFORNIA
SCHOOL DISTRICTS IN 1999
District Number District Average Test
Score (5th grade)
Student-Teacher Ratio Expenditure per Pupil
($)
Percentage of
Students Learning
English
1 690.8 17.89 6385 0.0
2 661.2 21.52 5099 4.6
3 643.6 18.70 5502 30
4 647.7 17.36 7102 0.0
5 640.8 18.67 5236 13.9
-
-
-
418 645.0 21.89 4403 24.3
419 672.2 20.20 4776 3.0
420 655.8 19.04 5993 5.0
SELECTED OBSERVATIONS ON THE GROWTH
RATE OF GDP IN THE U.S.: QUARTERLY
DATA, 1960Q1 – 2013Q1
Observation Number Date (year:quarter) GDP Growth Rate (% at
an annual rate)
1 1960:Q1 8.8
2 1960:Q2 -1.5
3 1960:Q3 1.0
4 1960:Q4 -4.9
5 1961:Q1 2.7
-
-
-
211 2012:Q3 2.7
212 2012:Q4 0.1
213 2013:Q1 1.1
SELECTED OBSERVATIONS ON CIGARETTE
SALES, PRICES, AND TAXES, BY STATE AND
YEAR FOR U.S. STATES, 1985-1995
State Year Cigarette Sales (Packs
per Capita)
Average Price per Pack
(including taxes), $
Total Taxes (Cigarette
excise tax + sales tax),
$
Alabama 1985 116.5 1.022 0.333
Arkansas 1985 128.5 1.015 0.370
Arizona 1985 104.5 1.086 0.362
-
-
West Virginia 1985 112.8 1.089 0.382
Wyoming 1985 129.4 0.935 0.240
Alabama 1986 117.2 1.080 0.334
-
-
Wyoming 1995 112.2 1.585 0.360
DATA COLLECTION
• Data collection means we are going to create a dataset by pooling data
from different sources into one file
• Just a reminder – each row will represent an observation, each column
will represent a different variable
• We are going to create a small cross -section data set by collecting data
from two separate sources
• World development indicators
• Economic Freedom Project
WORLD DEVELOPMENT INDICATORS
• Let’s collect Real GDP per capita data produced by Worldbank
• Simply google “World Bank real GDP per capita”, find what you are looking
for in the results and download the .csv file
• There are three files in the folder you have just downloaded, the largest one
contains the data. Please use excel to open it
• You only need the following three variables: country name, country code and the
data for 2016, please keep them and delete all the columns/rows you won’t need
when you upload the data to Stata.
• Let’s look at the observations, are all of them countries?
• Rename the “2016” column as RGDPPC and save the file as a .csv
• Barney… GDPPC_WB.xlsx
ECONOMIC FREEDOM PROJECT
• Please go to freetheworld.com, then ”dataset” then “download entire
dataset” or “download filtered dataset”
• You want summary index for every country for 2016. Please keep the
following columns: Iso code (please rename it into “country code”),
countries, and summary index (you can rename it). Make sure your data is
ready to be uploaded to Stata (i.e. remove unnecessary rows)
• Look at the list of countries, are any of them not countries?
• Please save this file as a .csv file
• We are going to be using the EFW dataset country list as the master country
list.
• Barney… EFW.xlsx
COMBINING THE TWO
• Please upload the World Bank data into Stata
• Save it as a Stata dataset: save GDPPC, replace
• Clear the window and upload your master data (EFW) into it
• Use the following command to merge the two datasets into one:
• merge 1:1 countrycode using GDPPC
• Stata output tells you how many observations it was able to match and how many it
was not.
• Sometimes country codes might differ slightly between one dataset and another. Let’s
see if we can find a pair for the unmatched master data ”by hand”?
• Sort your data according to its “merged” status
• sort _merge
TWO VARIABLES IS NOT ENOUGH
• If you wanted to find out the relationship between income and
institutions of two countries having two variables in the regression
would not be enough
• You can find more variables by looking up world development indicators
https://databank.worldbank.org/data/reports.aspx?source=world-
development-indicators
• Please pick another variable (possibly based on your knowledge from
ECON 202) to add to your dataset and regression.
COMBINING THE TWO CONT’D
• See if you can find matches for the unmatched observations in the
master data by using ctrl-f
• If you can, please change the country code in one of the datasets (either
GDPPC or EFW) and try merging again
• Now we just need to drop the observations that are unmatched from the
world bank and drop the _merge variable
• Done!
• We can now try to regress real income per capita on economic freedom
MERGING IN EXCEL BY USING VLOOKUP
• Vlookup is used for data organized vertically, if your data is organized
horizontally, please use hlookup
• Please have both datasets open in front of you, pick whichever one is
going to be your master data. In the “using” data the values by which
you are matching have to be in the first column
• In this example, master data – EFW index, using data – GDP
• Vlookup(the value you want to match by, the dataset you want to be
matched to the current dataset, the column with the return value, full
match (FALSE) or partial match (TRUE).
• Make sure your new dataset looks nice and clean.
RESHAPE
• The data might be organized in a long or a wide format
• The data you download from world bank is in a wide format
• To run regressions you need data to be in a long format/you also need
to perform the reshape function for DEP 1.
• To convert it to long format you can use Stata function “reshape”
• Let’s work on this part of DEP 1 together
RESHAPE THE TEMPERATURE
ANOMALIES DATA
• Download the CO2 data and the temperature anomalies data (doing
economics project website)
• Currently the temperature anomalies data is in a wide format
• We are going to use January and February temps, please pick two different
months for your own submission
• In Stata: keep year jan feb
• save jannfebtemps, replace
• reshape
• When you type in the last command it teaches you how to use the reshape
command
RESHAPE CONT-D
• To be able to use the reshape command our variables that are being
reshaped need to be re-named (i.e. a1 a2)
• Stata: rename jan anomaly1
• rename feb anomaly2
• reshape long anomaly, i(year) j(month)
• save jannfebtemps, replace
• clear
MERGE THE TWO DATASETS
• Upload the master data (CO2)
• Make sure the variables by which you are merging have the same names
across the two datasets
• Merge as before, but list all of the variables by which you are merging
(both year and month)
• Keep the matched observations
OTHER DATA SOURCES
• Some datasets: polity IV http://www.systemicpeace.org/inscrdata.html
• World bank data
• IMF data
• Federal reserve data
• World values survey http://www.worldvaluessurvey.org/wvs.jsp
• Census
• Book of the states http://knowledgecenter.csg.org/kc/category/content-type/content-
type/book-states
• National Center for Education Statistics https://nces.ed.gov
• Wealth of education data by state
OTHER DATA SOURCES CONT’D
• Political ideology data https://voteview.com/data
• Economic freedom of the world index https://www.fraserinstitute.org/economic-
freedom/dataset?geozone=world&year=2015&page=dataset&min-year=2&max-year=0&filter=0
• Economic freedom of North America https://www.fraserinstitute.org/economic-freedom/dataset?geozone=na&year=2015&page=dataset&min-
year=2&max-year=0&filter=0&selectedCountry=USA
• Pennworld tables https://www.rug.nl/ggdc/productivity/pwt/
• Globalization index https://www.kof.ethz.ch/en/forecasts-and-indicators/indicators/kof-globalisation-index.html
• CIRI Human Rights Data http://www.humanrightsdata.com/p/data-documentation.html
• Some Econ journals, i.e. American Economic Review
• https://www.aeaweb.org/journals/aer
• Some good Economists
• i.e. Daron Acemoglu https://economics.mit.edu/faculty/acemoglu
• Center for disease control
• https://data.cdc.gov/

Contenu connexe

Similaire à Topic 7 (data)

Etl - Extract Transform Load
Etl - Extract Transform LoadEtl - Extract Transform Load
Etl - Extract Transform LoadABDUL KHALIQ
 
4 Statistical Software.pptx
4 Statistical Software.pptx4 Statistical Software.pptx
4 Statistical Software.pptxkaleabtegegne
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational databaseHitesh Mohapatra
 
Data Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxData Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxHamzaAli998966
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vsIan Feller
 
Information retrieval dynamic indexing
Information retrieval dynamic indexingInformation retrieval dynamic indexing
Information retrieval dynamic indexingNadia Nahar
 
CCXG Workshop, May 2021, Camila Labarca
CCXG Workshop, May 2021, Camila LabarcaCCXG Workshop, May 2021, Camila Labarca
CCXG Workshop, May 2021, Camila LabarcaOECD Environment
 
Data Configuration for Analysis with Matt Hansen at StatStuff
Data Configuration for Analysis with Matt Hansen at StatStuffData Configuration for Analysis with Matt Hansen at StatStuff
Data Configuration for Analysis with Matt Hansen at StatStuffMatt Hansen
 
CHAPTER 5- DATA EXPLORATION AND VALIDATION
CHAPTER 5- DATA EXPLORATION AND VALIDATIONCHAPTER 5- DATA EXPLORATION AND VALIDATION
CHAPTER 5- DATA EXPLORATION AND VALIDATIONBenjJamiesonDuag2
 
1 introductory slides (1)
1 introductory slides (1)1 introductory slides (1)
1 introductory slides (1)tafosepsdfasg
 
Data and Donuts: Data cleaning with OpenRefine
Data and Donuts: Data cleaning with OpenRefineData and Donuts: Data cleaning with OpenRefine
Data and Donuts: Data cleaning with OpenRefineC. Tobin Magle
 
Rsqrd AI: Zestimates and Zillow AI Platform
Rsqrd AI: Zestimates and Zillow AI PlatformRsqrd AI: Zestimates and Zillow AI Platform
Rsqrd AI: Zestimates and Zillow AI PlatformSanjana Chowdhury
 
BI Knowledge Sharing Session 2
BI Knowledge Sharing Session 2BI Knowledge Sharing Session 2
BI Knowledge Sharing Session 2Kelvin Chan
 

Similaire à Topic 7 (data) (20)

Etl - Extract Transform Load
Etl - Extract Transform LoadEtl - Extract Transform Load
Etl - Extract Transform Load
 
4 Statistical Software.pptx
4 Statistical Software.pptx4 Statistical Software.pptx
4 Statistical Software.pptx
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational database
 
Data Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxData Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptx
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs
 
BI Suite Overview
BI Suite OverviewBI Suite Overview
BI Suite Overview
 
Information retrieval dynamic indexing
Information retrieval dynamic indexingInformation retrieval dynamic indexing
Information retrieval dynamic indexing
 
DW (1).ppt
DW (1).pptDW (1).ppt
DW (1).ppt
 
CCXG Workshop, May 2021, Camila Labarca
CCXG Workshop, May 2021, Camila LabarcaCCXG Workshop, May 2021, Camila Labarca
CCXG Workshop, May 2021, Camila Labarca
 
EDA
EDAEDA
EDA
 
Data Configuration for Analysis with Matt Hansen at StatStuff
Data Configuration for Analysis with Matt Hansen at StatStuffData Configuration for Analysis with Matt Hansen at StatStuff
Data Configuration for Analysis with Matt Hansen at StatStuff
 
CHAPTER 5- DATA EXPLORATION AND VALIDATION
CHAPTER 5- DATA EXPLORATION AND VALIDATIONCHAPTER 5- DATA EXPLORATION AND VALIDATION
CHAPTER 5- DATA EXPLORATION AND VALIDATION
 
Data structures
Data structuresData structures
Data structures
 
Chapter 6.pptx
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptx
 
1 introductory slides (1)
1 introductory slides (1)1 introductory slides (1)
1 introductory slides (1)
 
Data and Donuts: Data cleaning with OpenRefine
Data and Donuts: Data cleaning with OpenRefineData and Donuts: Data cleaning with OpenRefine
Data and Donuts: Data cleaning with OpenRefine
 
Star schema
Star schemaStar schema
Star schema
 
Week_2_Lecture.pdf
Week_2_Lecture.pdfWeek_2_Lecture.pdf
Week_2_Lecture.pdf
 
Rsqrd AI: Zestimates and Zillow AI Platform
Rsqrd AI: Zestimates and Zillow AI PlatformRsqrd AI: Zestimates and Zillow AI Platform
Rsqrd AI: Zestimates and Zillow AI Platform
 
BI Knowledge Sharing Session 2
BI Knowledge Sharing Session 2BI Knowledge Sharing Session 2
BI Knowledge Sharing Session 2
 

Plus de Ryan Herzog

Chapter 14 - Great Recession
Chapter 14 - Great RecessionChapter 14 - Great Recession
Chapter 14 - Great RecessionRyan Herzog
 
Chapter 13 - AD/AS
Chapter 13 - AD/ASChapter 13 - AD/AS
Chapter 13 - AD/ASRyan Herzog
 
Chapter 12 - Monetary Policy
Chapter 12 - Monetary PolicyChapter 12 - Monetary Policy
Chapter 12 - Monetary PolicyRyan Herzog
 
Chapter 11 - IS Curve
Chapter 11 - IS CurveChapter 11 - IS Curve
Chapter 11 - IS CurveRyan Herzog
 
Chapter 10 - Great Recession
Chapter 10 - Great RecessionChapter 10 - Great Recession
Chapter 10 - Great RecessionRyan Herzog
 
Chapter 9 - Short Run
Chapter 9 - Short RunChapter 9 - Short Run
Chapter 9 - Short RunRyan Herzog
 
Chapter 8 - Inflation
Chapter 8 - InflationChapter 8 - Inflation
Chapter 8 - InflationRyan Herzog
 
Chapter 7 - Labor Market
Chapter 7 - Labor MarketChapter 7 - Labor Market
Chapter 7 - Labor MarketRyan Herzog
 
Chapter 6 - Romer Model
Chapter 6 - Romer Model Chapter 6 - Romer Model
Chapter 6 - Romer Model Ryan Herzog
 
Chapter 5 - Solow Model for Growth
Chapter 5 - Solow Model for GrowthChapter 5 - Solow Model for Growth
Chapter 5 - Solow Model for GrowthRyan Herzog
 
Chapter 4 - Model of Production
Chapter 4 - Model of ProductionChapter 4 - Model of Production
Chapter 4 - Model of ProductionRyan Herzog
 
Chapter 3 - Long-Run Economic Growth
Chapter 3 - Long-Run Economic GrowthChapter 3 - Long-Run Economic Growth
Chapter 3 - Long-Run Economic GrowthRyan Herzog
 
Chapter 2 - Measuring the Macroeconomy
Chapter 2 - Measuring the MacroeconomyChapter 2 - Measuring the Macroeconomy
Chapter 2 - Measuring the MacroeconomyRyan Herzog
 
Topic 7 (questions)
Topic 7 (questions)Topic 7 (questions)
Topic 7 (questions)Ryan Herzog
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)Ryan Herzog
 
Topic 6 (model specification)
Topic 6 (model specification)Topic 6 (model specification)
Topic 6 (model specification)Ryan Herzog
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)Ryan Herzog
 
Topic 4 (binary)
Topic 4 (binary)Topic 4 (binary)
Topic 4 (binary)Ryan Herzog
 
Topic 3 (Stats summary)
Topic 3 (Stats summary)Topic 3 (Stats summary)
Topic 3 (Stats summary)Ryan Herzog
 

Plus de Ryan Herzog (20)

Chapter 14 - Great Recession
Chapter 14 - Great RecessionChapter 14 - Great Recession
Chapter 14 - Great Recession
 
Chapter 13 - AD/AS
Chapter 13 - AD/ASChapter 13 - AD/AS
Chapter 13 - AD/AS
 
Chapter 12 - Monetary Policy
Chapter 12 - Monetary PolicyChapter 12 - Monetary Policy
Chapter 12 - Monetary Policy
 
Chapter 11 - IS Curve
Chapter 11 - IS CurveChapter 11 - IS Curve
Chapter 11 - IS Curve
 
Chapter 10 - Great Recession
Chapter 10 - Great RecessionChapter 10 - Great Recession
Chapter 10 - Great Recession
 
Chapter 9 - Short Run
Chapter 9 - Short RunChapter 9 - Short Run
Chapter 9 - Short Run
 
Chapter 8 - Inflation
Chapter 8 - InflationChapter 8 - Inflation
Chapter 8 - Inflation
 
Chapter 7 - Labor Market
Chapter 7 - Labor MarketChapter 7 - Labor Market
Chapter 7 - Labor Market
 
Chapter 6 - Romer Model
Chapter 6 - Romer Model Chapter 6 - Romer Model
Chapter 6 - Romer Model
 
Chapter 5 - Solow Model for Growth
Chapter 5 - Solow Model for GrowthChapter 5 - Solow Model for Growth
Chapter 5 - Solow Model for Growth
 
Chapter 4 - Model of Production
Chapter 4 - Model of ProductionChapter 4 - Model of Production
Chapter 4 - Model of Production
 
Chapter 3 - Long-Run Economic Growth
Chapter 3 - Long-Run Economic GrowthChapter 3 - Long-Run Economic Growth
Chapter 3 - Long-Run Economic Growth
 
Chapter 2 - Measuring the Macroeconomy
Chapter 2 - Measuring the MacroeconomyChapter 2 - Measuring the Macroeconomy
Chapter 2 - Measuring the Macroeconomy
 
Inequality
InequalityInequality
Inequality
 
Topic 7 (questions)
Topic 7 (questions)Topic 7 (questions)
Topic 7 (questions)
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)
 
Topic 6 (model specification)
Topic 6 (model specification)Topic 6 (model specification)
Topic 6 (model specification)
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)
 
Topic 4 (binary)
Topic 4 (binary)Topic 4 (binary)
Topic 4 (binary)
 
Topic 3 (Stats summary)
Topic 3 (Stats summary)Topic 3 (Stats summary)
Topic 3 (Stats summary)
 

Dernier

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 

Dernier (20)

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 

Topic 7 (data)

  • 1. DATA Ryan Herzog, Ph.D. Associate Professor Gonzaga University
  • 2. FINAL GROUP/INDIVIDUAL PROJECT • Think about a relationship you’ve learned about in economics… • CO2 Emissions and GDP growth • International trade and growth • Consumption and disposable income • Economic growth and investment • Government debt and economic growth • Look at Our World in Data for ideas… • Try to think about macro/international ideas. Data are much easier to find. • There are also lots of good macro/regional data at the state level (check the U.S. Census).
  • 3. LITERATURE REVIEW • Google scholar is your friend. • Find at least 3 papers related to your topic. Summarize their sample, data, methodology, and results
  • 4. DATA • Many • We have more data than we know what to do with!
  • 5. IN THIS TOPIC • Types of data • Cross-sectional • Pooled • Panel • Data collection • Data sources
  • 6. SELECTED OBSERVATIONS ON TEST SCORES AND OTHER VARIABLES FOR CALIFORNIA SCHOOL DISTRICTS IN 1999 District Number District Average Test Score (5th grade) Student-Teacher Ratio Expenditure per Pupil ($) Percentage of Students Learning English 1 690.8 17.89 6385 0.0 2 661.2 21.52 5099 4.6 3 643.6 18.70 5502 30 4 647.7 17.36 7102 0.0 5 640.8 18.67 5236 13.9 - - - 418 645.0 21.89 4403 24.3 419 672.2 20.20 4776 3.0 420 655.8 19.04 5993 5.0
  • 7. SELECTED OBSERVATIONS ON THE GROWTH RATE OF GDP IN THE U.S.: QUARTERLY DATA, 1960Q1 – 2013Q1 Observation Number Date (year:quarter) GDP Growth Rate (% at an annual rate) 1 1960:Q1 8.8 2 1960:Q2 -1.5 3 1960:Q3 1.0 4 1960:Q4 -4.9 5 1961:Q1 2.7 - - - 211 2012:Q3 2.7 212 2012:Q4 0.1 213 2013:Q1 1.1
  • 8. SELECTED OBSERVATIONS ON CIGARETTE SALES, PRICES, AND TAXES, BY STATE AND YEAR FOR U.S. STATES, 1985-1995 State Year Cigarette Sales (Packs per Capita) Average Price per Pack (including taxes), $ Total Taxes (Cigarette excise tax + sales tax), $ Alabama 1985 116.5 1.022 0.333 Arkansas 1985 128.5 1.015 0.370 Arizona 1985 104.5 1.086 0.362 - - West Virginia 1985 112.8 1.089 0.382 Wyoming 1985 129.4 0.935 0.240 Alabama 1986 117.2 1.080 0.334 - - Wyoming 1995 112.2 1.585 0.360
  • 9. DATA COLLECTION • Data collection means we are going to create a dataset by pooling data from different sources into one file • Just a reminder – each row will represent an observation, each column will represent a different variable • We are going to create a small cross -section data set by collecting data from two separate sources • World development indicators • Economic Freedom Project
  • 10. WORLD DEVELOPMENT INDICATORS • Let’s collect Real GDP per capita data produced by Worldbank • Simply google “World Bank real GDP per capita”, find what you are looking for in the results and download the .csv file • There are three files in the folder you have just downloaded, the largest one contains the data. Please use excel to open it • You only need the following three variables: country name, country code and the data for 2016, please keep them and delete all the columns/rows you won’t need when you upload the data to Stata. • Let’s look at the observations, are all of them countries? • Rename the “2016” column as RGDPPC and save the file as a .csv • Barney… GDPPC_WB.xlsx
  • 11. ECONOMIC FREEDOM PROJECT • Please go to freetheworld.com, then ”dataset” then “download entire dataset” or “download filtered dataset” • You want summary index for every country for 2016. Please keep the following columns: Iso code (please rename it into “country code”), countries, and summary index (you can rename it). Make sure your data is ready to be uploaded to Stata (i.e. remove unnecessary rows) • Look at the list of countries, are any of them not countries? • Please save this file as a .csv file • We are going to be using the EFW dataset country list as the master country list. • Barney… EFW.xlsx
  • 12. COMBINING THE TWO • Please upload the World Bank data into Stata • Save it as a Stata dataset: save GDPPC, replace • Clear the window and upload your master data (EFW) into it • Use the following command to merge the two datasets into one: • merge 1:1 countrycode using GDPPC • Stata output tells you how many observations it was able to match and how many it was not. • Sometimes country codes might differ slightly between one dataset and another. Let’s see if we can find a pair for the unmatched master data ”by hand”? • Sort your data according to its “merged” status • sort _merge
  • 13. TWO VARIABLES IS NOT ENOUGH • If you wanted to find out the relationship between income and institutions of two countries having two variables in the regression would not be enough • You can find more variables by looking up world development indicators https://databank.worldbank.org/data/reports.aspx?source=world- development-indicators • Please pick another variable (possibly based on your knowledge from ECON 202) to add to your dataset and regression.
  • 14. COMBINING THE TWO CONT’D • See if you can find matches for the unmatched observations in the master data by using ctrl-f • If you can, please change the country code in one of the datasets (either GDPPC or EFW) and try merging again • Now we just need to drop the observations that are unmatched from the world bank and drop the _merge variable • Done! • We can now try to regress real income per capita on economic freedom
  • 15. MERGING IN EXCEL BY USING VLOOKUP • Vlookup is used for data organized vertically, if your data is organized horizontally, please use hlookup • Please have both datasets open in front of you, pick whichever one is going to be your master data. In the “using” data the values by which you are matching have to be in the first column • In this example, master data – EFW index, using data – GDP • Vlookup(the value you want to match by, the dataset you want to be matched to the current dataset, the column with the return value, full match (FALSE) or partial match (TRUE). • Make sure your new dataset looks nice and clean.
  • 16. RESHAPE • The data might be organized in a long or a wide format • The data you download from world bank is in a wide format • To run regressions you need data to be in a long format/you also need to perform the reshape function for DEP 1. • To convert it to long format you can use Stata function “reshape” • Let’s work on this part of DEP 1 together
  • 17. RESHAPE THE TEMPERATURE ANOMALIES DATA • Download the CO2 data and the temperature anomalies data (doing economics project website) • Currently the temperature anomalies data is in a wide format • We are going to use January and February temps, please pick two different months for your own submission • In Stata: keep year jan feb • save jannfebtemps, replace • reshape • When you type in the last command it teaches you how to use the reshape command
  • 18. RESHAPE CONT-D • To be able to use the reshape command our variables that are being reshaped need to be re-named (i.e. a1 a2) • Stata: rename jan anomaly1 • rename feb anomaly2 • reshape long anomaly, i(year) j(month) • save jannfebtemps, replace • clear
  • 19. MERGE THE TWO DATASETS • Upload the master data (CO2) • Make sure the variables by which you are merging have the same names across the two datasets • Merge as before, but list all of the variables by which you are merging (both year and month) • Keep the matched observations
  • 20. OTHER DATA SOURCES • Some datasets: polity IV http://www.systemicpeace.org/inscrdata.html • World bank data • IMF data • Federal reserve data • World values survey http://www.worldvaluessurvey.org/wvs.jsp • Census • Book of the states http://knowledgecenter.csg.org/kc/category/content-type/content- type/book-states • National Center for Education Statistics https://nces.ed.gov • Wealth of education data by state
  • 21. OTHER DATA SOURCES CONT’D • Political ideology data https://voteview.com/data • Economic freedom of the world index https://www.fraserinstitute.org/economic- freedom/dataset?geozone=world&year=2015&page=dataset&min-year=2&max-year=0&filter=0 • Economic freedom of North America https://www.fraserinstitute.org/economic-freedom/dataset?geozone=na&year=2015&page=dataset&min- year=2&max-year=0&filter=0&selectedCountry=USA • Pennworld tables https://www.rug.nl/ggdc/productivity/pwt/ • Globalization index https://www.kof.ethz.ch/en/forecasts-and-indicators/indicators/kof-globalisation-index.html • CIRI Human Rights Data http://www.humanrightsdata.com/p/data-documentation.html • Some Econ journals, i.e. American Economic Review • https://www.aeaweb.org/journals/aer • Some good Economists • i.e. Daron Acemoglu https://economics.mit.edu/faculty/acemoglu • Center for disease control • https://data.cdc.gov/

Notes de l'éditeur

  1. The remaining rows present data for other districts. The order of the rows is arbitrary, and the number of the district, which is called the observation number, is an arbitrarily assigned number that organizes the data. As you can see in the table, all the variables listed vary considerably.
  2. The data in each row correspond to a different time period (year and quarter). In the first quarter of 1960, for example, GDP grew 8.8% at an annual rate. In other words, if GDP had continued growing for four quarters at its rate during the first quarter of 1960, the level of GDP would have increased by 8.8%.
  3. The number of entities in a panel data set is denoted n, and the number of time periods is denoted T. In the cigarette data set, we have observations on n = 48 continental U.S. states (entities) for T = 11 years (time periods) from 1985 to 1995. Thus there is a total of n × T = 48 × 11 = 528 observations.