Statalist


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

st: looping


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   stata list <statalist@hsphsun2.harvard.edu>
Subject   st: looping
Date   Fri, 5 Dec 2008 22:26:09 +0000 (GMT)

--- Daniel Mackay wrote to me privately:
> I hope you don't object to me e-mailing you off list about a problem
> I have in STATA. It is a very basic question and one that would
> probably get ignored but I simply can't work it out.

This is not a good idea, as is discussed in the statalist FAQ point 5:
http://www.stata.com/support/faqs/res/statalist.html#private

> I would like to use STATA's InvFtail distribution function within a
> loop. Essentially I need to output approx 12,000 F values for the 3
> inputs that it requires. i.e the two n vales and the p value for the
> test. I have tried looping but with foreach etc and have dissected
> some ado files to get an idea as to how it is done but I am not
> getting anywhere with it. 
 
*--------------- begin example --------------------
forvalues n1 = 1/10 {
	forvalues n2 = 1/10 {
		forvalues p = .1(.1).9 { 
			di invFtail(`n1',`n2',`p')
		}
	}
}
*---------------- end example ---------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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