Home › Forums › ASREG : Rolling window and Fama-MacBeth Regressions › asreg: estimate regression by year and sector in Stata
Tagged: asreg, by year, estimate regression, id
I’m an accounting Ph.D. student and write a tutorial paper now.
I often have to estimate regressions by year and by sector. In this article that I am working on now, this is also necessary. The way I did it was by using the “if” subcommands.
But I found your package when I was reviewing it. When I try to estimate my regression by command:
bys Firm_id Year : asreg TA_jones1991 InverseAT_jones1991 delta_Revenue_jones1991 PPE_jones1991
The columns generated in my database are all like n.a.
The database is available in this link:
Can you help me when I may be wrong?
All the best.
bys firmid year means that the regression will be run on each year within each firmid, in your dataset, there are only one observation for each firmid per year, therefore, regression cannot be estimated on a single observation.
The correct command would be
bys B3_sector Year
Enter something special: