Statalist


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

st: AW: Help with Metap command - repeating commands


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
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: [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/



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