Check out -statsby-:
. help statsby
Nick
On Mon, Jan 14, 2013 at 10:25 PM, Ben Hoen <bhoen@lbl.gov> wrote:
> I have a loop (e.g., forvalues i=1/4 {...) that will run a regression (using
> areg) across different subsets of data and then estimate a linear
> combination of the regression coefficients from that subset.
>
> I would like to take the results stored in r() [specifically r(estimate) and
> r(se) from lincom] and a value calculated from those two [e.g., local tstat
> = r(estimate)/ r(se)] and store those three values in a table for each
> subset. Once the loop has run through all subsets I would like to display
> the table.
>
> I imagine the table looking like this:
>
> group est se tstat
> 1 0.06 0.023 2.61
> 2 0.11 0.09 1.22
> 3 0.02 0.06 0.33
> 4 0.05 0.04 1.25
>
> Any advice would be very appreciated.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/