Stata Review Session Economics 1018 Abby Williamson and Hongyi Li November 17, 2006.

Slides:



Advertisements
Similar presentations
Housekeeping: Variable labels, value labels, calculations and recoding
Advertisements

Research Methods Lecture 3 More STATA Ian Walker Room S2.109   Slides available at:
AP STATS: Warm-Up Do Math SAT scores help to predict Verbal SAT scores. Make a scatter plot. Find the least squares regression and r and r-squared. Also.
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Adrián de la Garza Jeremy Green 27 March 2009
Getting Started With STATA How do I do this? It probably opened automatically, but you may have to save it to the desktop, and double-click it to open.
Chapter 11 Contingency Table Analysis. Nonparametric Systems Another method of examining the relationship between independent (X) and dependant (Y) variables.
The World’s Fastest Crash Course in Statistics Or, What You Need to Know to Answer Your Research Question 13 November 2006.
Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane.
Sociology 601 Class 25: November 24, 2009 Homework 9 Review –dummy variable example from ASR (finish) –regression results for dummy variables Quadratic.
Stata Introduction Sociology 229A, Class 2 Copyright © 2008 by Evan Schofer Do not copy or distribute without permission.
Sociology 601 Class 23: November 17, 2009 Homework #8 Review –spurious, intervening, & interactions effects –stata regression commands & output F-tests.
Multiple Regression – Basic Relationships
Getting Started with your data
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
How to Analyze Data? Aravinda Guntupalli. SPSS windows process Data window Variable view window Output window Chart editor window.
Econometric Analysis Using Stata
Multiple Regression. In the previous section, we examined simple regression, which has just one independent variable on the right side of the equation.
Stata Workshop #1 Chiu-Hsieh (Paul) Hsu Associate Professor College of Public Health
Harvard-MIT Data Center (HMDC)
API-208: Stata Review Session Daniel Yew Mao Lim Harvard University Spring 2013.
Statistics and Quantitative Analysis U4320 Segment 12: Extension of Multiple Regression Analysis Prof. Sharyn O’Halloran.
STATA Mini Course Fall 2015 Jane Leber Herr Littauer 113 1Stata Mini Course – Spring 2015.
Research Project Statistical Analysis. What type of statistical analysis will I use to analyze my data? SEM (does not tell you level of significance)
HAOMING LIU JINLI ZENG KENAN ERTUNC GENETIC ABILITY AND INTERGENERATIONAL EARNINGS MOBILITY 1.
Department of Economics Trinity College Dublin, Ireland Day 2: Labour Market Participation and Income Earning Activities 1.
Using Weighted Data Donald Miller Population Research Institute 812 Oswald Tower, December 2008.
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
VIDEO: INTRODUCTION TO STATA EMBA Data Analysis Professor Timothy Simcoe Boston University School of Management.
Analyses using SPSS version 19
June 21, Objectives  Enable the Data Analysis Add-In  Quickly calculate descriptive statistics using the Data Analysis Add-In  Create a histogram.
Data Analysis Econ 176, Fall Populations When we run an experiment, we are always measuring an outcome, x. We say that an outcome belongs to some.
Correlation & Regression Correlation does not specify which variable is the IV & which is the DV.  Simply states that two variables are correlated. Hr:There.
Getting Started with Stata 2/11/2010 Tom Tomberlin Nealia Khan Learning Technologies Center Harvard Graduate School of Education.
STATA for S-052 M. Shane Tutwiler Your Friendly S-040 Lecturer William Johnston IT Services Harvard Graduate School of Education.
Basics of Biostatistics for Health Research Session 1 – February 7 th, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health.
Overview of Regression Analysis. Conditional Mean We all know what a mean or average is. E.g. The mean annual earnings for year old working males.
PSC 47410: Data Analysis Workshop  What’s the purpose of this exercise?  The workshop’s research questions:  Who supports war in America?  How consistent.
APPLIED DATA ANALYSIS IN CRIMINAL JUSTICE CJ 525 MONMOUTH UNIVERSITY Juan P. Rodriguez.
Review Section on Instrumental Variables Economics 1018 Abby Williamson and Hongyi Li October 11, 2006.
Today Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation – GOF.
Basics of Biostatistics for Health Research Session 4 – February 28, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health Sciences.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Stata: Getting Starting and Being Productive with VA Data Give me six hours to chop down a tree and I will spend the first four sharpening the axe. --Abraham.
Regression Chapter 5 January 24 – Part II.
The Research Process First, Collect data and make sure that everything is coded properly, things are not missing. Do this for whatever program your using.
Introduction to Eviews Eviews Workshop September 6, :30 p.m.-3:30 p.m.
(Slides not created solely by me – the internet is a wonderful tool) SW388R7 Data Analysis & Compute rs II Slide 1.
Correlation and Regression Stats. T-Test Recap T Test is used to compare two categories of data – Ex. Size of finch beaks on Baltra island vs. Isabela.
Metrics Lab Econometric Problems Lab. Import the Macro data from Excel and use first row as variable names Time set the year variable by typing “tsset.
An Introduction to Microsoft Excel Presented to EC 303 Research Methods Block 7 March 25, :30-2:30 p.m. Palmer 02.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Happy Tuesday Scientists!
Categorical Variables in Regression
Econ 326 Prof. Mariana Carrera Lab Session X [DATE]
QM222 Class 13 Section D1 Omitted variable bias (Chapter 13.)
QM222 A1 More on Excel QM222 Fall 2017 Section A1.
DEPARTMENT OF COMPUTER SCIENCE
QM222 A1 On tests and projects
QM222 A1 Visualizing data using Excel graphs
POSC 202A: Lecture Lecture: Substantive Significance, Relationship between Variables 1.
ECONOMETRICS ii – spring 2018
Migration and the Labour Market
Stata Basic Course Lab 4.
Introduction to Matlab
Categorical Data In Chapter 3 we introduced the idea of categorical data. In Chapter 15 we explored probability rules and when events are independent.
Evaluation of Public Policy
Ordinary Least Square estimator using STATA
Presentation transcript:

Stata Review Session Economics 1018 Abby Williamson and Hongyi Li November 17, 2006

Agenda Administrative Issues Empirical exercise - clarifications Log and.do files in Stata Introducing Variables Reviewing Stata Commands An Example Questions

Administrative Issues Office Hours –Abby – Monday, November 27, Tuesday, November 28, 4-6 –Hongyi – Wednesday, November 29, 6-8 Problem Set Questions – BOTH TFs with questions. We will reply to the entire class. Keep track of these s as common questions will arise. –Addresses:

Empirical Exercise – some clarifications Question 2b: you may organize your graphs in whichever way you see fit. –For example: with happiness, generate 1 bar graph for each wave, with 1 bar per country representing average level of happiness Question 3: Don’t have to include too many controls (which would reduce significance). –Also, don’t use educational levels (which are unevenly measured across countries) Question 4: Don’t just use US data. You have to show that trust has declined, relative to other countries, in younger cohorts in the US.

Keeping Track of Stata Work Opening data –Open Stata, use “open” button on menu (folder) to open relevant dataset –Dataset too big? Set memory higher: set mem 500m (or bigger …) Open a log –Ex: log using c:/WilliamsonPS Remember to use: capture log close Start a.do file –Use the envelope button to open a.do file, save it under a name you’ll remember. Write and run your program from there so that you can re-run analyses without rewriting everything.

Example: A Few Variables E037.- Government responsibility People should take more responsibility to provide for themselves vs. The government should take more responsibility to ensure that everyone is provided for –1 'People should take more responsibility' –2 '2' –3 '3' –4 '4' –5 '5' –6 '6' –7 '7' –8 '8' –9 '9' –10 'The government should take more responsibility'

Example: A Few Variables A025.- Respect and love for parents With which of these two statements do you tend to agree? (CODE ONE ANSWER ONLY) –A. Regardless of the qualities and faults of one's parents, one must always love and respect them. –B. One does not have the duty to respect and love parents who have not earned it by their behavior and attitudes. 1 'Always' 2 'Earned' 3 'Neither'

Reviewing Stata Commands Rename –Ex.rename e037 big_govt (Renames variable e037 “big_govt”) –Ex.Rename a025 obedience (Renames variable a025 “obedience”) Recode –Ex. recode obedience (1=1) (0=2) (Recodes the variable so that always=1, earned=0)

Reviewing Stata Commands Tabulate –Ex. tab obedience (Tells what proportion of respondents falls into each category.) –Ex.tab obedience if sex==1 (Tabulates obedience for female respondents.) Summarize –Ex. sum big_govt (Gives basic summary statistics (mean, range, etc.) for big_govt.)

Reviewing Stata Commands Sort and By –Ex. sort country by country: tab obedience (Sorts by country and then tabulates obedience for each country.) Collapse –Ex.collapse (mean) age height, by (country) (Makes a new dataset with one observation per country, and two variables: the mean age and mean height for the people of that country)

Reviewing Stata Commands –Graph Ex. graph twoway scatter age height –(Generates a scatter plot with age and height as the axes) Ex. graph bar (mean) age, over (country) –(Generates a bar graph where each bar corresponds to a country and the height of each bar is the average age for that country)

Reviewing Stata Commands Generate –Ex. gen highhealth=0 replace highhealth=1 if health==1 (Generates a dummy in which all observations equal 0 unless respondent reports excellent health, in which case highhealth is replaced with 1.) –Ex.gen agesq=age*age (Creates a variable that is the square of the respondent’s age.) –Ex.gen femeduc=sex*educ (Creates an interaction variable that measures the differential impact of education on women.)

Reviewing Stata Commands Drop –Ex.drop a001 a002 a003 a004 (Drops those four variables, keeping all others.) –Ex.drop if age<18 (Drops all children.) Keep –Ex.keep a001 a002 a003 a004 (Keeps those four variables, dropping all others.) –Ex.keep if age<18 (Keeps only children.)

Reviewing Stata Commands Correlate –Ex.corr big_govt obedience (Gives the correlation between health and happiness.) Regress –Ex.reg big_govt obedience educ age income, r (Regresses happiness on health controlling for education, age, and income. “,r” indicates use of robust standard errors – almost always a good idea.)

Reviewing Stata Commands Regress –Ex.reg big_govt obedience educ age income, r »(Regresses happiness on health controlling for education, age, and income. “,r” indicates use of robust standard errors – almost always a good idea.) –Ex.xi: reg big_govt obedience educ i.country, r »(Regresses happiness on health controlling for education, age, and income, with country fixed effects.)

Reviewing Stata Commands –IV Regress Ex: ivreg2 big_govt (obedience=religion) educ age income, r –(Regresses happiness on health controlling for education, age, and income, while instrumenting for happiness using religion.) –ivreg2 is preferred to ivreg, although both run 2SLS. You have to install it – search for it from the help window.