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

st: RE: RE: access and save ttest results


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: access and save ttest results
Date   Thu, 7 Jul 2005 21:46:51 +0100

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/



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