Statalist


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

st: AW: Help with Metap command - repeating commands


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Help with Metap command - repeating commands
Date   Sat, 25 Apr 2009 18:02:52 +0200

<> 

Use the -foreach- loop:

*************
clear*
set obs 1000

//construct dataset
forv i=1/300{
	gen var`i'=runiform()
}   

//run on vars var1 to var300
foreach var of varlist var1-var300{
	metap `var'
}
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Elizabeth
Rolland
Gesendet: Samstag, 25. April 2009 01:33
An: statalist@hsphsun2.harvard.edu
Betreff: st: Help with Metap command - repeating commands

Hi, I am using the metap command to calculate Fisher's and Edgington's
additive methods (separately) on a few hundred variables. Rather than
rerun the command for each variable, I would like to write a syntax
file. Is there any way I can tell STATA to repeat the metap command on
each variable in a range (e.g. var1-var300)?

Thanks!

Elizabeth Rolland

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


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