Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: creating and appending to a local table using results stored in r()


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: creating and appending to a local table using results stored in r()
Date   Tue, 15 Jan 2013 00:38:43 +0000

Check out -statsby-:

. help statsby

Nick

On Mon, Jan 14, 2013 at 10:25 PM, Ben Hoen <[email protected]> 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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index