Statalist


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

st: Using gllamm for bivariate meta-regression with known within-study covariance(correlation) and variance matrix


From   "Ben Dwamena" <bdwamena@med.umich.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Using gllamm for bivariate meta-regression with known within-study covariance(correlation) and variance matrix
Date   Thu, 27 Aug 2009 13:35:48 -0400

I have been using gllamm for bivariate linear mixed models for meta-analysis where the known level 1 variances are uncorrelated based on code provided by Joseph Coveney (shown after my signature).

How may I use gllamm if the level 1 variances and covariance (or within study correlations) are available i.e  
Both level 1 and 2 are bivariate normal with unstructured variance-covariance matrix.
mvmeta can be used but does not allow for covariates (i.e.meta-regression)

Thanks and best regards,
Ben Dwamena
--------------------------------------------------------------------------------------------------

clear
set more off
/* The dataset is from G. A. Colditz,
   F. B. Brewer, C. S. Berkey, E. M.
   Wilson, E. Burdick, H. V. Fineberg &
   F. Mosteller, Efficacy of BCG vaccine
   in the prevention of tuberculosis.
   _Journal of the American Medical Association_
   271:698-702, 1994, cited in H. C. van
   Houwelingen, L. R. Arends and T. Stijnen,
   Tutorial in Biostatistics.  Advanced methods
   in meta-analysis:  multivariate approach and
   meta-regression.  _Statistics in Medicine_
   21:589-624, 2002. */
input trial vd vwd nvd nvwd
1 4 119 11 128
2 6 300 29 274
3 3 228 11 209
4 62 13536 248 12619
5 33 5036 47 5761
6 180 1361 372 1079
7 8 2537 10 619
8 505 87886 499 87892
9 29 7470 45 7232
10 17 1699 65 1600
11 186 50448 141 27197
12 5 2493 3 2338
13 27 16886 29 17825
end
compress
/* This is in the spirit of the SAS data step
   in the article; a Stata implementation ab initio
   would be briefer, -reshape-d long first. */
generate float lno1 = ln(vd/ vwd)
generate float lno0 = ln(nvd / nvwd)
generate float var1 = 1/vd + 1/vwd
generate float var0 = 1/nvd + 1/nvwd
/* The article is confusing in that it
   describes that the standard errors are stored
   in the PARMSDATA file (p. 602), but what's stored
   are really variance estimates.  For stability,
   -gllamm- parametrizes the residual variance as
   logarithms of the standard error, so . . . */
generate float lsd1 = ln(sqrt(var1))
generate float lsd0 = ln(sqrt(var0))
reshape long lno var lsd, i(trial) j(trt)
/* The two random effects, one for each treatment. */
quietly tabulate trt, generate(grp)
eq grp1: grp1
eq grp2: grp2
/* Setting up the fixed ("known") residual
   (first-level) variances. */
egen int cell = group(trial trt)
quietly tabulate cell, generate(dum)
eq wgt: dum1-dum26
forvalues i = 1/26 {
    local dummy = lsd[`i']
    constraint define `i' [lns1]dum`i' = `dummy'
}
macro drop dummy
/* First-pass estimation.  -gllamm- doesn't apply
   constraints in preliminary estimation of the fixed
   effects (if -gllamm- decides to use itself for this),
   so don't allow it to iterate here and get lost trying
   to estimate as many or more parameters as there are data. */
gllamm lno grp1 grp2, nocons i(trial) nrf(2) eqs(grp1 grp2) ///
  s(wgt) constraint(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ///
  17 18 19 20 21 22 23 24 25 26) noest
matrix A = M_initf
/*  Fit the model here. */
gllamm lno grp1 grp2, nocons i(trial) nrf(2) eqs(grp1 grp2) ///
  s(wgt) constraint(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ///
  17 18 19 20 21 22 23 24 25 26) from(A) long adapt trace allc
exit


Ben Adarkwa Dwamena, MD

Assistant Professor of  Radiology
Division of Nuclear Medicine
Department of Radiology
University of Michigan Medical School
1500 E. Medical Center Drive
B1  G505   University  Hospital
Ann Arbor, MI 48109-0028

bdwamena@umich.edu

http://sitemaker.umich.edu/metadiagnosis



Staff Physician
D748 Nuclear Medicine Service (115), 
VA Ann Arbor Health Care System
2215 Fuller Road
Ann Arbor, MI 48105
734-761-7886 Phone
734-761-5229 Fax


>>> <sophiarh@berkeley.edu> 09/02/08 6:54 AM >>>
The Fall North American Stata Users Group meeting will be held November
13 and 14, 2008 in Downtown San Francisco (Handlery Union Square Hotel).

See the conference web site http://www.stata.com/meeting/fnasug08/ for
more information.

The invited speakers are Kit Baum (Department of Economics, Boston
College), Colin Cameron (Department of Economics, UC Davis), John Neuhaus
(Department of Epidemiology and Biostatistics, UC San Francisco) and Joe
Schafer (Department of Statistics, Penn State). Stata developers will also
attend the meeting, both to present and to take notes during the popular
"wishes and grumbles" session.

The scientific organizing committee (Xiao Chen, Phil Ender, Estie Hudes,
Tony Lachenbruch, Bill Mason, Sophia Rabe-Hesketh, and Doug Steigerwald)
invites you to join the meeting, as a presenter or as an attendee.

The deadline for submitting abstracts is September 30; see the conference
web site for details. The registration fee is $160 for both days ($65 for
students).

We hope to see many of you there!


*
*   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/

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index