Review the Stata do-file written below thatsimulates the omitted variable bias. 1. Discuss the step-by-step
Review the Stata do-file written below thatsimulates the omitted variable bias. 1. Discuss the step-by-step
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Review the Stata do-file written below thatsimulates the omitted variable bias.
1. Discuss the step-by-step procedure for the OVB simulation as written in the Stata do-file. In the regression of Y on T. is the estimated coefficient for T biased? why?
2. Does adding variable S on the regression of Y on T change the estimated coefficient T? why?
3.Reproduce the empirical density figure and explain your finding.
* ==============================================================================
*
* Title : OLS simulation: ommitted variable bias (OVB)
* Authors : Gumilang Aryo Sahadewo
* Stata version : 12
* Date created : December 4th 2017
* Last modified : December 7th 2017
*
* ==============================================================================
** INITIALIZATION
version 12
set more off
clear all
cap log close // use this command if you are used to using log files
** SET NUMBER OF OBSERVATIONS
set obs 1000
** PART A: MULTIPLE LINEAR REGRESSION
// generate a random explanatory variable
gen T = 5*runiform()
gen S = 10*runiform()
// the variable v is correlated with t
gen V = 5*runiform() + 0.8*T
// generate random error
gen U = rnormal()
// simulate y
gen Y = 5 + 10*T + 4*S + 8*V + 5*U
// Create random sample
gen sample = runiform()
sort sample
// regress the full model
eststo clear
// are the estimated coefficients biased?
eststo m3: reg Y T S V
// suppose that you don't observe the variable v
// unobsevable variables are something you encounter many times in econometrics
// what would be the consequence of ommitting an important variable?
eststo m1: reg Y T
// is the estimated coefficient:
// 1. underestimated?
// 2. overestimated?
// does adding variable s help?
eststo m2: reg Y T S
// set the directory for your tables
global path /// set your directory below
"/Users/gasahadewo/Documents/STATA/Lecture/2020_microeconometrics"
cd "$path/table" // change the directory
// into word
esttab m1 m2 m3 using ovb.rtf, b(a3) se nonumbers nonotes ///
mtitles("model 1" "model 2" "model 3") ///
scalars("N Obs" "r2 R-sq" "r2_a Adj. R-sq") ///
star(+ 0.10 * 0.05 ** 0.01) label ///
replace
// or into LaTex
esttab m1 m2 m3 using ovb, b(a3) se nonumbers nonotes ///
mtitles("model 1" "model 2" "model 3") ///
scalars("N Obs" "r2 R-sq" "r2_a Adj. R-sq") ///
star(+ 0.10 * 0.05 ** 0.01) label ///
replace booktabs
// finite sample estimation
global ssize 100
// set the directory for your figures
cd "$path/figure" // change the directory
preserve
gen b1_hat = .
gen b1_true = .
foreach i of numlist 1/100 {
// generate random numbers
qui gen rand`i' = runiform()
sort rand`i'
// regress using 30 randomly chosen sample
qui reg Y T if _n
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education