190 likes | 361 Views
Panel Data Analysis in STATA Binam Ghimire. Learning Objectives. Importing file into STATA Running panel data regression Run fixed, random effect test and use of Hausman to test which (among fixed and random) is better. Importing Data from Excel into Stata :Theory.
E N D
Panel Data Analysis in STATA Binam Ghimire
Learning Objectives • Importing file into STATA • Running panel data regression • Run fixed, random effect test and use of Hausman to test which (among fixed and random) is better
Importing Data from Excel into Stata:Theory • Papers used: Rajan and Zingles (1995) and Charles AmoYartey (20XX) – Capital Structure and the Financing unquoted companies in Africa, Evidence from Ghana • Equation can be found in page 1452, Rajan and Zingles (1995)
Importing Data from Excel into Stata:Theory • File to practice • Find the file (file: named:EDITED_REGDATA) Note: The name of the countries have been given numbers Compensation (Both panel and time variables need to be numeric from STATA) • To import the data in stata: copy and paste from excel to data editor inside data (Or you can import the file from excel, Check various techniques of importing data into STATA)
Importing Data from Excel into Stata1. Inform that your file is a panel data • Now you need to tell STATA that your file is a panel data. For this you need to use the command • Xtset code years • tsset code years, yearly (worked for 8.1 version) • Now run the pooled regression estimates using the regress command: • . regress debtrafirmszprtabtytgiblitymbv • Note here we have followed (Rajan and Zingles 1995, page 1452)
Importing Data from Excel into Stata2. Pooled estimate • Now run the pooled regression estimates using the regress command: . regress debtrafirmszprtabtytgiblitymbv Note here we have followed (Rajan and Zingles 1995, equation, p. 1452,)
Importing Data from Excel into Stata: Fixed Effect Estimate • The command for the fixed effect is : . xtregdebtrafirmszprtabtytgiblitymbv, fe
Importing Data from Excel into Stata3. Hausman Test • Store it (we want to test hausman to see which is good) • Command to store is: . estimates store random
Importing Data from Excel into Stata4. Random Test • The command is • xtregdebtrafirmszprtabtytgiblitymbv, re
Importing Data from Excel into Stata4. Storing • Again store is • . estimates store random
What should I use: Fixed Effects or Random Effects? • A HausmanTest Approach • In a simple equation yit = xitb + ai + uitHausman(1978) suggested a test to check whether the individual effects (ai) are correlated with the regressors (Xit): • Under the Null Hypothesis: Orthogonality, i.e., no correlation between individual effects and explanatory variables. Both random effects and fixed effects estimators are consistent, but the random effects estimator is efficient, while fixed effects is not
What should I use: Fixed Effects or Random Effects? • Ho hypothesis is that estimates by random effect are not different from those from fixed effects. Therefore they are consistent and random effects estimators should be preferred. • Under the Alternative Hypothesis: Individual effects are correlated with the X's. In this case, random effects estimator is inconsistent, while fixed effects estimator is consistent and efficient. • The H1 hypothesis states that estimates by random effects are different from those of fixed effects. Therefore they are not consistent and the random effect estimators are not appropriate.
What should I use: Fixed Effects or Random Effects? • After storing the results of fixed and random, the command in STATA is • hausman fixed random
What should I use: Fixed Effects or Random Effects? • So, based on the test above, we can see that the tests statistic (25.82) is greater than the critical value of a Chi-squared (4df, 5%) = 9.48. Null hypothesis rejected. Fixed effects preferred.