st: looping

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

st: looping

Maarten buis
--- 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:

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

Hope this helps,

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

*   For searches and help try: