Dear everyone,

I have data like this
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float date byte firm float(y x)
13179  1    .02249275 .023846
13179  2    .02473811 .023846
13179  3    .02917535 .023846
13179  4  -.003698677 .023846
13179  5    .01971747 .023846
13179  6   .004339309 .023846
13179  7   .021966416 .023846
13179  8   .009107822 .023846
13179  9   .022625485 .023846
13179 10    .02582048 .023846
13179 11   .029426813 .023846
13179 12   .028985094 .023846
13179 13   .006517308 .023846
13179 14   .023857683 .023846
13179 15    .03715372 .023846
13208  1    .02372855 .012409
13208  2   .013736684 .012409
13208  3 -.0009553593 .012409
13208  4   .033223897 .012409
13208  5   .011025373 .012409
13208  6   .001453319 .012409
13208  7   .013162767 .012409
13208  8    .02752227 .012409
13208  9    .01317317 .012409
13208 10    .01949181 .012409
end
format %td date2
I want 2 problems:
1. How can I estimate the OLS regression (y on x) , but for each firm. For example, I have 10 firms through the period (monthly data) , and I want to see the intercept's of 10 firms in 10 OLS regressions.
2. How can I show the frequency for distributions of t-statistic of the intercept (or any variables that we want) for my whole sample?
for example: we can divide my frequency for range of t-statistic into 10 interval, and calculate let Stata count how many firm we have for each interval of t-statistic

Thank you for your consideration