Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
Megan Fesinmeyer <mfesinme@WHI.org> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: RE: Estout for metan?, |

Date |
Fri, 30 Jul 2010 09:06:18 -0700 |

Thank you so much for this idea! I will give it a try. I had sort of given up yesterday, and spent the day reformatting my data to perform meta-analysis in METAL software. I'd much rather use Stata, so it would be great if I can get this approach to work. -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Tiago V. Pereira Sent: Thursday, July 29, 2010 1:14 PM To: statalist@hsphsun2.harvard.edu Subject: st: RE: Estout for metan?, Megan, A very straightforward solution is to create a folder with all your meta-analyses numbered from 1 to 200, say, meta_analysis_1.dta, meta_analysis_2.dta, and so on. Then, loop over them storing the results as locals. Finally, create a single file will all results and use -outsheet- to get a xls file (tab-delimited by default). An very simple example is presented below. All you need to modify is the path to find your files. If you use windows the paths are like "C:\myfiles\meta_analysis_`i'.dta" Hope this helps. Copy-paste tasks are really prone to errors! Let me know if this simple code works for you. I did not check its accuracy. Tiago */------- start code ----------------------- local N = 200 */ total no. of meta-analyses forvalues i = 1/`N' { */ change the path below use "/home/my_meta_analyses/meta_analysis_`i'.dta", clear qui metan a b c d, or random notable nograph local ES_`i' = r(ES) local CI_low_`i' = r(ci_low) local CI_upp_`i' = r(ci_upp) local I2_`i' = r(i_sq) local p_het_`i' = r(p_het) } drop _all set obs `N' gene ES =. gene CI_lower = . gene CI_upper = . gene I2 =. gene p_het = . forvalues i = 1/`N' { replace ES = ES_`i' in `i' replace CI_lower = CI_low_`i' in `i' replace CI_upper = CI_upp_`i' in `i' replace I2 = I2_`i' in `i' replace p_het = p_het_`i' in `i' } gene ID = _n */ change the path below outsheet using "/home/my_meta_analyses/all_resuls_in_a_single_file.xls", replace */------- end code ----------------------- * * 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/

**References**:**st: RE: Estout for metan?,***From:*"Tiago V. Pereira" <tiago.pereira@mbe.bio.br>

- Prev by Date:
**re:Re: st: Strange behaviour of Stata 11 under GNU/Linux** - Next by Date:
**st: adjust vs. margins revisited** - Previous by thread:
**st: RE: Estout for metan?,** - Next by thread:
**st: -xtgee- with multiple clusters** - Index(es):