<>
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: [email protected]
[mailto:[email protected]] Im Auftrag von Elizabeth
Rolland
Gesendet: Samstag, 25. April 2009 01:33
An: [email protected]
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/