Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Fw: RE: formatting and exporting ttest results


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Fw: RE: formatting and exporting ttest results
Date   Thu, 27 Apr 2006 16:22:49 -0400

Juanita-
You can save ado files to the appropriate folder shown by -sysdir-
(which is probably c:\ado for you), but I would recommend you try to
write a loop that writes out the info you want to a text file
directly.  I use this trick all the time, and once you learn it, you
will too, I expect.

tempname out
file open `out'  using yourtab.txt, write replace
file write `out' _tab "Group1" _tab "Group2" _tab "Difference"
foreach v of varlist var1 var2 etc {
 qui reg `v' group1 group2, nocons
 qui test group1=group2
 file write `out' _n "`: var la `v''"
 file write `out' _tab "`: di %4.3f _b[group1]'"
 file write `out' _tab "`: di %4.3f _b[group2]'"
 file write `out' _tab "`: di %4.3f _b[group1]-_b[group2]'"
 if r(p)<.05 file write "*"
 file write `out' _n _tab "(`: di %4.3f _se[group1]')"
 file write `out' _tab "(`: di %4.3f _se[group2]')"
 qui reg `v' group1
 file write `out' _tab "(`: di %4.3f _se[group1]')"
}
file close `out'
type yourtab.txt

On 4/27/06, Riano, Juanita <[email protected]> wrote:
> Hendro,
>
> I am going to take advantage of your ado file, but how do you install
> ado files that don't come from the SSC archive? Thank you in advance
>
> Juanita

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index