# [R-meta] Fwd: SV: Re:: Question: Metafor R package - rma and rma.mv function

Simona Frederiksen @imon@@frederik@en @ending from hotm@il@com
Mon Aug 6 16:57:39 CEST 2018

```Thank you for your help. I just have one final question. On some forums they write that sigma estimated from more complex models are the same as tau. Is it so?

Best wishes,

Simona

________________________________
Fra: Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
Sendt: Friday, August 3, 2018 4:01:43 PM
Til: Simona Frederiksen; r-sig-meta-analysis using r-project.org
Emne: RE: [R-meta] Fwd: SV: Re:: Question: Metafor R package - rma and rma.mv function

Hi Simona,

No, I would not drop est_id if it is non-significant.

The weights depend on the model fitted. By default, the weights, or rather, the weight matrix, is the inverse of the model-implied marginal var-cov matrix of the estimates. For a bit of a discussion of this, see:

https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2018-July/000909.html

For the three-level model described here:

http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011

the marginal var-cov matrix of the estimates consists of blocks, where the size of each block depends on the number of estimates in the cluster. The off-diagonal elements in each block are equal to the cluster-level variance component. The diagonal elements are equal to the sampling variances plus the estimate-level variance component plus the cluster-level variance component. So, for example, a cluster with 3 estimates would look like this:

[v_1 + s^2_id + s^2_study  s^2_study                 s^2_study               ]
[                          v_2 + s^2_id + s^2_study  s^2_study               ]
[                                                    v_3 + s^2_id + s^2_study]

The inverse of this block-diagonal is the weight matrix. By default, weights() only shows the diagonal of this weight matrix. Use weights(model, type="matrix") to see the full matrix.

Best,
Wolfgang

-----Original Message-----
From: Simona Frederiksen [mailto:simona.frederiksen using hotmail.com]
Sent: Wednesday, 01 August, 2018 13:16
To: Viechtbauer, Wolfgang (SP); r-sig-meta-analysis using r-project.org
Subject: SV: [R-meta] Fwd: SV: Re:: Question: Metafor R package - rma and rma.mv function

Dear Wolfgang,

I read through the link and I am wondering if I should skip est_id if I find it non-significant?

Regarding the weights, I'am not quite aware of how this is computed since 1/vi does not result in the weights that I can extract from weights(res). The model that I am fitting is it as follows: yi = mean + uj[i] + ei for the i'th comparison and the j'th study when using the rma.mv function for the full model (=inclusion of est_id in addition to study id)? And how would it look if not including est_id? Finally, I am wondering how the weights are applied to the model and how it is calculated?

Best wishes,
Simona

________________________________________
Fra: Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
Sendt: Monday, July 30, 2018 12:47:30 PM
Til: Simona Frederiksen; r-sig-meta-analysis using r-project.org
Emne: RE: [R-meta] Fwd: SV: Re:: Question: Metafor R package - rma and rma.mv function

Dear Simona,

https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2018-July/000949.html

Best,
Wolfgang

-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of Simona Frederiksen
Sent: Wednesday, 25 July, 2018 22:45
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] Fwd: SV: Re:: Question: Metafor R package - rma and rma.mv function

Dear Michael,

Thank you for your fast reply. It is very appreciated. I should have changed it to plain text now.

Maybe I'am not quite aware of how this is computed. The model that I am fitting is it as follows: yi = mean + uj[i] + ei for the i'th comparison and the j'th study when using the rma.mv function? And how is the weights applied to it or calculated?

I tried to use the profile.rma.mv() function and I got one maxima. Can I then assume that it is converged?

Best wishes,

Simona
________________________________
Fra: Michael Dewey <lists using dewey.myzen.co.uk<mailto:lists using dewey.myzen.co.uk>>
Sendt: Wednesday, July 25, 2018 3:06:06 PM
Til: Simona Frederiksen; r-sig-meta-analysis using r-project.org<mailto:r-sig-meta-analysis using r-project.org>
Emne: Re:: [R-meta] Question: Metafor R package - rma and rma.mv function

Simona Frederiksen <simona.frederiksen using hotmail.com<mailto:simona.frederiksen using hotmail.com>> wrote :

Dear Simona

Given the calculated variances (vi) the weights seem quite OK to me.

Would the question underlying the convergence issue be better answered by using profile.rma.mv()?

Michael.

> Hi,
>
> I have some question sthat I would like to get posted regarding the metafor R
> package and the rma and rma.mv function. It goes like this:
>
> Hi,
>
> I am at the moment working in the R package 'metafor' in order to perform a
> meta-analysis which I carry out in collaboration with the Danish Headache
> Center. I just figured that I have to use the rma.mv function since I have
> several effect sizes per study (for two studies).
>
> I have following questions that I hope you can help me answer:
>
>   1.  When I calculate the weights for each study, the studies that have more
> effect sizes receive a really high weight compared to the other studies with
> just one effect size. So it seems that these studies primarily are used to
> calculate the overall effect size even though N seems to be quite small?
>
>   1.  How can I see convergence when I use the rma.mv function? When using the
> rma function, it turns up when adding verbose = T. And if it does not converge,
> what would be ideal to do?
>
> Here is an example:
> library("metafor")
> study_id

[[alternative HTML version deleted]]

```