Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Joe Canner <jcanner1@jhmi.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: RE: eform |
Date | Tue, 1 Apr 2014 13:54:47 +0000 |
Claire, In looking for information on how -metareg- applies the -randomsize- option, I realized that I made a mistake previously: the calculation of the bubble size (when the -randomsize- option is not used) should be the inverse of the *square* of the WSSE: gen size=1/(SElogHRa^2) When using the -randomsize- option, the bubble size is based on tau2, which is scalar estimated during the regression. You can get tau2 from the regression printout and then calculate the bubble size as the inverse of WSSE+tau2: gen randomsize=1/(SElogHRa^2+tau2) scatter HRa eGFR [aw=randomsize], msymbol(oh) || line efit eGFR, sort ||, legend(off) ytitle(HRa) Alternatively, in your case, you can get the value of tau2 from e(tau2): gen randomsize=1/(SElogHRa^2+`e(tau2)') Note that the calculation of tau2 in -metareg- is more complicated if you use other options for calculating tau2 (-mm-, -reml-, -eb-). Also note that if tau2 is negative, tau2 should be set to 0. Regards, Joe -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Claire Rushton Sent: Tuesday, April 01, 2014 6:54 AM To: statalist@hsphsun2.harvard.edu Subject: Re: st: RE: eform This is excellent Joe, thank you - it worked perfectly. Could I ask one further question? Can you accomodate randomsize with this approach? Many thanks Claire On 31 March 2014 20:58, Joe Canner <jcanner1@jhmi.edu> wrote: > Claire, > > For whatever reason, the author of -metareg- has chosen not to incorporate the -eform- option into the -graph- option. If you believe this is an important oversight, you should make a suggestion to the author to that effect. > > In any case, it shouldn't be difficult to rectify this situation on your own. The code from metareg.ado that implements the -graph- option in your particular example isn't very involved: > > . tempvar fit > . qui predict `fit' > . local size 1/`v' > . local yti : variable label `y' > . scatter `y' `xvars' [aw=`size'], msymbol(oh) line `fit' `xvars', sort , legend(off) ytitle( `yti') > > Accordingly, you would just need to take the exponential of the dependent variable and of the fitted value and redo the graph. Something like this: > > metareg logHRa eGFR, wsse(SElogHRa) eform graph > predict fit > gen HRa=exp(logHRa) // or use the actual value of HR if you have it already > gen efit=exp(fit) > gen size=1/SElogHRa > scatter HRa eGFR [aw=size], msymbol(oh) || line efit eGFR, sort ||, legend(off) ytitle(HRa) > > Whether this is an appropriate way to do meta-analysis of hazard ratios is another story (one which I'm not qualified to comment on). > > Regards, > Joe Canner > Johns Hopkins University School of Medicine > > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Claire Rushton > Sent: Monday, March 31, 2014 2:19 PM > To: statalist@hsphsun2.harvard.edu > Subject: st: eform > > I am using the eform option for a bubble plot using metareg but the y > axis is still showing the log hazard ratio - please advise? > > The command i have used is > > metareg logHRa eGFR, wsse(SElogHRa) eform graph > > The y axis still shows logHRa. > > Thanks > Claire > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ -- Claire A Rushton Lecturer in Nursing and NIHR Doctoral Research Fellow Health Services Research Unit Innovation Centre 1 Keele University Staffordshire ST5 5NB Telephone: 01782 733768 Email: c.a.rushton@keele.ac.uk * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/