Mira Road Awesome 100% Independent Call Girls NUmber-9833754194-Dahisar Inter...
ย
Lab practice session.pptx
1. Advanced econometrics and Stata
Practice
Dr. Chunxia Jiang
Business School, University of Aberdeen, UK
Beijing , 17-26 Nov 2019
2. ๏ช Topics and schedule
Sessions plan
10ๆ17ๆฅ Evening โ
L1-2 Introduction to Econometrics and Stata
10ๆ18ๆฅ Evening โ
L3-4 Data, single regression
Morning โ
L5-6 (1) Hypothesis testing, Multi-regression ,
Afternoon L5-6 (2) Violation of assumptions
Morning โ
L7-8 Panel data models & Endogeneity
Evening Exercises and practice
Morning โ
L9-10 Time series models
Afternoon L11-12 Frontier1 SFA & practice
10ๆ24 Evening L13-14๏ผ Frontier2 DEA & practice
10ๆ25ๆฅ Evening L15-16 DID & practice
Morning Revision
Afternoon Exam
10ๆ20ๆฅ
10ๆ19ๆฅ
10ๆ22ๆฅ
10ๆ26ๆฅ
3. ๏ช sysuse auto
๏ช Sum
๏ช we have data on the mileage rating and weight of 74
automobiles. The variables in our data are mpg,
weight, and foreign. The last variable assumes the
value 1 for foreign and 0 for domestic automobiles.
We wish to fit the model
Linear regression
4. ๏ช sysuse auto
๏ช Sum
๏ช we have data on the mileage rating and weight of 74
automobiles. The variables in our data are mpg, weight, and
foreign. The last variable assumes the value 1 for foreign and 0
for domestic automobiles. We wish to fit the model
๏ช regress mpg weight foreign
Linear regression
6. R2
๏ช Use which R-square?
๏ช Good practice to use adjusted R-square, particularly when the
number of explanatory variables is not very small compared
with the number of observations
๏ช But this has no theoretical justification.
๏ช Adjusted R-square is reported by most statistical packages
๏ช Compare R-square of two models
๏ช The sample size and the dependent variable must be the
same
๏ช The explanatory variables may take any form
๏ช Allocating the multiple R-square between the regressors?
๏ช Little point to do so
6
7. ๏ช Fitted model
๏ช a graph comparing mpg with weight:
๏ช twoway (scatter mpg weight)
๏ช scatter mpg weight
๏ช This is to be expected because energy usage per distance should
increase linearly with weight, but mpg is measuring distance per
energy used.
๏ช We could obtain a better model by generating a new variable
measuring the number of gallons used per 100 miles (gp100m)
and then using this new variable in our model:
Linear regression
10. ๏ช We wish to fit a regression of the weight of an
automobile against its length
๏ช regress weight length
๏ช we wish to impose the constraint that the weight is
zero when the length is zero.
๏ช regress weight length, noconstant
Linear regression
12. ๏ช Specifying the vce(robust) option is equivalent to
requesting White-corrected standard errors in the
presence of heteroskedasticity.
๏ช We use the automobile data: the energy efficiency of
cars:
๏ช the amount of energy (measured in gallons of gasoline)
that the cars in the data need to move 1,000 pounds of
their weight 100 miles.
Heteroskedasticity and robust
standard errors
13. ๏ช generate gpmw = ((1/mpg)/weight)*100*1000
๏ช Sum
๏ช We are going to examine the relative efficiency of
foreign and domestic cars.
๏ช regress gpmw foreign
๏ช regress gpmw foreign, vce(robust)
14.
15.
16. ๏ช Which is right? Notice that gpmw is a variable with
considerable heteroskedasticity
๏ช tabulate foreign, summarize(gpmw)
17. ๏ช . webuse nlswork
๏ช . xtset idcode
๏ช we will model ln wage in terms of completed years of
schooling (grade), current age and age squared, current
years worked (experience) and experience squared,
current years of tenure on the current job and tenure
squared, whether black (race = 2), whether residing in an
area not designated a standard metropolitan statistical
area (SMSA), and whether residing in the South.
Panel data
18. ๏ช xtreg ln_w grade age c.age#c.age ttl_exp
c.ttl_exp#c.ttl_exp tenure > c.tenure#c.tenure 2.race
not_smsa south, fe
19. ๏ช xtreg ln_w grade age c.age#c.age ttl_exp
c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race
not_smsa south, fe vce(robust)
๏ช Although the estimated coefficients are the same with and
without the vce(robust) option, the robust estimator
produced larger standard errors and a p-value for c.ttl
exp#c.ttl exp above the conventional 10%. The F test of v i =
0 is suppressed because it is too difficult to compute the
robust form of the statistic when there are more than a
few panels.
Fixed-effects models with robust
standard errors