Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: difficulty using META command and exporting output in Stata

From   "Steichen, Thomas" <>
To   <>
Subject   st: RE: difficulty using META command and exporting output in Stata
Date   Wed, 16 Oct 2002 15:26:46 -0400

John Hopkins writes (in part): 

> I am working on a meta analysis of studies looking at the 
> risk of cancer in asthma patients.  We are using the META 
> command to generate our summary estimates (we have adjusted 
> odds ratios, with standard errors).  I am trying to take 
> pooled estimate and confidence limits out of the table as 
> variables, without manually typing them in.
> Here is what I typed into stata to generate the output 
> tables: meta loggeneff seloggeneff, eform graph(f) cline 
> xline(1) xlab(.1,1,10)
> id(studygen) b2title(gender-specific estimates) print
> Here are the output tables:
> Meta-analysis (exponential form)
>        |  Pooled      95% CI         Asymptotic      No. of
> Method |     Est   Lower   Upper  z_value  p_value   studies
> -------+----------------------------------------------------
> Fixed  |   1.068   1.038   1.099    4.489    0.000      2
> Random |   1.073   0.989   1.165    1.689    0.091
> Test for heterogeneity: Q=  8.025 on 1 degrees of freedom (p= 
> 0.005) Moment-based estimate of between studies variance =  0.003
>                    |      Weights      Study       95% CI
>              Study |   Fixed  Random     Est   Lower   Upper
> -------------------+----------------------------------------
>   Vesterinen Males | 2013.93  280.27    1.12    1.07    1.17
> Vesterinen Females | 2646.46  289.91    1.03    0.99    1.07
> How can I save the summary estimate and confidence limits 
> from the analysis (random effects) to variables?  I need to 
> take these values and do some data management and additional 
> analysis with them, and I do not want to hand-enter every 
> estimate generated from the command.

The help file for -meta- indicates that it saves the 
following results (copied directly from the help file):

Saved values

S_1    Theta (fixed)
S_2    SE Theta (fixed)
S_3    Lower CI Limit (fixed)
S_4    Upper CI Limit (fixed)  
S_5    Asymptotic Z-value (fixed)
S_6    Asymptotic p-value (fixed)
S_7    Theta (random)
S_8    SE Theta (random)
S_9    Lower CI Limit (random)
S_10   Upper CI Limit (random)
S_11   Asymptotic Z-value (random)
S_12   Asymptotic p-value (random)
S_13   Between-studies Variance, tau^2 

So, what you want is S_7, S_9 and S_10 and these are saved as
global macros.  You can paste these values into variables just 
like any other global values, for example:

gen est=.
gen ll=.
gen ul=.


replace est = $S_7 in 1
replace ll  = $S_9 in 1
replace ul  = $S_10 in 1

It is the $ that tell Stata to use a global.


CONFIDENTIALITY NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information.  If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system.  Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.

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