[R-meta] I2 for a multilevel model with subsets
Tharaka S. Priyadarshana
th@r@k@@@pr|y@d@r@h@n@ @end|ng |rom gm@||@com
Thu Aug 26 14:52:34 CEST 2021
Thank you!
It worked :)
-Tharaka
On Thu, Aug 26, 2021 at 8:15 PM Viechtbauer, Wolfgang (SP) <
wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
> Dear Tharaka,
>
> Try:
>
> W <- diag(m1$vi)
>
> Best,
> Wolfgang
>
> >-----Original Message-----
> >From: R-sig-meta-analysis [mailto:
> r-sig-meta-analysis-bounces using r-project.org] On
> >Behalf Of Tharaka S. Priyadarshana
> >Sent: Thursday, 26 August, 2021 13:15
> >To: r-sig-meta-analysis using r-project.org
> >Subject: [R-meta] I2 for a multilevel model with subsets
> >
> >Dear all,
> >
> >I am trying to calculate I2 for a multilevel model with subsets –
> >following this,
> >https://www.metafor-project.org/doku.php/tips:i2_multilevel_multivariate
> >
> >My model looks like as below,
> >m1<- rma.mv(yi, vi, random = ~ 1 | Study_ID / Sub_sudy_ID, data=dat,
> >subset=(Taxa_treatment=="Abundance")&(Taxa_fine=="Coleoptera"))
> >
> >Then I ran,
> >W <- diag(1/dat$vi) # this work
> >X <- model.matrix(m1) # this work
> >P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W # this does
> not
> >work
> >Here I get the following error message,
> >"Error in W %*% X : non-conformable arguments"
> >
> >Could someone please help me with this.
> >
> >Thank you,
> >Tharaka
>
[[alternative HTML version deleted]]
More information about the R-sig-meta-analysis
mailing list