Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: RE: access and save ttest results


From   "Christoph Wolff" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: access and save ttest results
Date   Fri, 8 Jul 2005 12:52:33 +0200

Scott and Nick, thank you very much for your help!
I am now using the following command, to save the test result in a variable:
gen test=r(t)
Best, Christoph


-----Urspr�ngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Nick Cox
Gesendet: Thursday, July 07, 2005 10:47 PM
An: [email protected]
Betreff: st: RE: RE: access and save ttest results

Among other alternatives, -statsby- springs 
to mind. 

Nick 
[email protected] 

Scott Merryman
 
> -return list- (or the reference manual [R] ttest) displays the saved
> results.  You will need to save of values you want after each 
> -ttest- as a
> scalar, macro, or a variable.
> 
> One way would:
> 
> sysuse auto, clear
> levelsof rep, local(levels)
> foreach l of loca levels {
> 	ttest mpg = 20 if rep == `l'
> 	scalar t_stat_`l' = r(t)
> }
> scalar list _all

Christoph Wolff

> > I am running several tests in Stata and I need to save the 
> results for
> > further calculations.
> > 
> > But how can I access the results of a test (e.g. the 
> t-value from a ttest)
> > and save them in a variable?

*
*   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/


*
*   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