Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Three-Four Level Meta-Analysis in Stata


From   [email protected] (Isabel Canette, StataCorp LP)
To   [email protected]
Subject   Re: st: Three-Four Level Meta-Analysis in Stata
Date   Tue, 03 Sep 2013 14:19:43 -0500

Jillian Turanovic <[email protected]> wanted to perform a 
meta-analysis with a three(four)-level hierarchical data.
Here Jillian uses the "three(four)" expression, because although
there are three observed levels, the first level contains aggregated
data, and therefore, there are four implicit levels.

On page 26 of the [ME] Manual we show how to perform a meta-analysis
with one(two)-level data. The on-line version of the [ME] Manual
is in the following link:
http://www.stata.com/bookstore/multilevel-mixed-effects-reference-manual/

The concepts explained in the documentation can be extended to the
multilevel case. Here I will simulate data with an additional level
(that is, a two(three)-level model, using the terminology in this post).

I will simulate 2000 observations (trials), grouped in studies. 
Variable -trial_sd- contains the standard deviation for each trial,
and -trial_result_0- is the result of the trial without accounting for
the study effect, which is added later. Here I will add a covariate
at the trial level, which will enter the fixed-effect part of the 
model. 


  clear

  set seed 13579
  set obs 2000
  gen trial  = _n
  gen x = .5*rnormal()
  gen trial_sd = .2*runiform() + .1 
  gen trial_result_0 = 3 + .3*x + trial_sd*rnormal() + sqrt(.2)*rnormal()
  gen study = int(trial/7) + 1
  gen study_eff = sqrt(.3)*rnormal()
  bysort study: replace study_eff = study_eff[1]


  gen trial_result = trial_result_0 + study_eff


  constraint 1 _b[var(trial_sd[study>trial]):_cons] = 1
  meglm trial_result x || study: || trial : trial_sd,  nocons constraint(1)

Here is the output:


Mixed-effects GLM                               Number of obs      =      2000
Family:                Gaussian
Link:                  identity

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
          study |      286          6        7.0          7
          trial |     2000          1        1.0          1
-----------------------------------------------------------

Integration method: mvaghermite                 Integration points =         7

                                                Wald chi2(1)       =    186.92
Log likelihood = -1765.1731                     Prob > chi2        =    0.0000
 ( 1)  [var(trial_sd[study>trial])]_cons = 1
------------------------------------------------------------------------------
trial_result |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           x |   .3163065   .0231356    13.67   0.000     .2709615    .3616515
       _cons |   2.984781   .0361036    82.67   0.000     2.914019    3.055543
-------------+----------------------------------------------------------------
study        |
   var(_cons)|   .3380683   .0311857                      .2821526    .4050653
-------------+----------------------------------------------------------------
study>trial  |
var(trial_sd)|          1  (constrained)
-------------+----------------------------------------------------------------
var(e.tria~t)|    .201222    .008267                      .1856542    .2180953
------------------------------------------------------------------------------

I used a big dataset to emphasize the fact that my original parameters have
been recovered. Notice that we have two random effects at the observation
level. -meglm- was able to identify the 'between-trial' part, provided that
the within-trial part was introduced via a constraint.


The "grand mean" we are interested in is the constant in the fixed part
of the model.

This method can be extended to more levels in a straightforward way.
In this example, I have included a covariate in the fixed-effects 
equation, which is the most common way to include covariates. However, 
it is also possible to include covariates as random slopes.
The model fitted here corresponds to the random-generating process used
in the simulation of the data. Jillian can follow this strategy to extend 
the example to fit a three(four) level model.

--Isabel
[email protected]
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index