Posted by: admin 3 weeks, 6 days ago
(Comments)
In this chapter, I want to discuss the Fixed effect estimator in Panel data regression.
Fixed Effect Estimator
Definition
Meaning of Fixed Effect based on the researcher in Econometrics (Torres Reyna 2010, Princeton Press)
 Use fixedeffects (FE) whenever you are only interested in analyzing the impact of variables that vary over time.
 FE explore the relationship between predictor and outcome variables within an entity (country, person, company, etc.).
 Each entity has its own individual characteristics that may or may not influence the predictor variables (for example, being a male or female could influence the opinion toward certain issue; or the political system of a particular country could have some effect on trade or GDP; or the business practices of a company may influence its stock price).
 When using FE we assume that something within the individual may impact or bias the predictor or outcome variables and we need to control for this. This is the rationale behind the assumption of the correlation between entity’s error term and predictor variables. FE remove the effect of those timeinvariant characteristics so we can assess the net effect of the predictors on the outcome variable.
 Another important assumption of the FE model is that those timeinvariant characteristics are unique to the individual and should not be correlated with other individual characteristics. Each entity is different therefore the entity’s error term and the constant (which captures individual characteristics) should not be correlated with the others. If the error terms are correlated, then FE is no suitable since inferences may not be correct and you need to model that relationship (probably using randomeffects), this is the main rationale for the Hausman test (presented later on in this document).
Mathematics Formula
This calculation is important in the process of calculating a panel data result from the unobserved heterogeneity.
Let say we have the mathematical formula that counts the number of Accident in the states
lets say
Basically fixed estimator will treat that all the data is having a time constant. Therefore we will delete the covariance or relation from unobserved heterogeneity with one of the variables in the model.

First let say we have the fatality formula, where yit is the fatalities

The fixed effect is used because we believe that
 Because we want to exclude any time constant, we try to demean the variable that has variance in time such as y
 And x
 And the error
 It gave us the simple algebra of
 It gave us the formula
Stata command
So we will use the data from Baum. And we also will use the dofiles instead of typing the command.
To use the data for the experiment. You can use from here.
If you are wondering how to use the dofiles in STATA please take a look on the video below.
One way Fixed effect estimator
To work on the do files for this state, please take a look at this video that shows how to use dofile in Stata
The data that we will use is the traffic and fatality rate in the US.
You can get the data from this link
https://www.statapress.com/data/imeus.html
Note: If you want to use your own data and you are confused about how to prepare the data from excel or any other spreadsheet into STATA panel data format. Then click this link or check out this video.
The command is very simple
xtreg depvar [independent variable], fe
#we will use this as the example
xtreg fatal beertax spircons unrate perincK, fe
Two way Fixed effect estimator
If you believe that there is a difference in terms of time, then its worth to put also the time as a variable. How to do that
Use this code
If you do not know how to use them do file in STATA check this video.
quietly tabulate year, generate(yr)
local j 0
forvalues i=82/87 {
local ++j
rename yr`j' yr`i'
quietly replace yr`i' = yr`i'  yr7
}
drop yr7
xtreg fatal beertax spircons unrate perincK yr*, fe
test yr82 yr83 yr84 yr85 yr86 yr87
How to read the result
I borrow the guidance from Princeton Press about how to read the result in STATA
There are couple of things that are important to be seen.
The thumb rules are
 The rho = rho show the intraclass correlation, it shows how the correlation inside the group of the variable.
 The t constant = if you want your hypothesis alternative to be accepted then the number should be above 1.96.
 The P>[t] = If you want your hypothesis alternative to be accepted then two tail P values should be below 0.1, 0,05, or 0.01.
 The Prob > F = If the F value less than 0.05 then the model is ok.
Comments