[R-meta] convert rma.mv() output to data.frame

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Wed Oct 6 23:25:51 CEST 2021


Hi Simon,

Please make a note of it when your question has been raised elsewhere so people can see what kind of answers have already been provided:

https://stackoverflow.com/questions/69459062/convert-part-of-a-statistical-functions-output-into-a-data-frame

This aside, I don't really understand how you want to make a data frame out of a combination of text and numbers of varying length. How many 'variables' is that data frame supposed to have? How many rows? What are the variables / rows supposed to contain? Or are you just after something like this?

data.frame(component=c("tau2", "rho"), value=c(res$tau2, res$rho))

Best,
Wolfgang

>-----Original Message-----
>From: Simon Harmel [mailto:sim.harmel using gmail.com]
>Sent: Wednesday, 06 October, 2021 22:47
>To: R meta
>Cc: Viechtbauer, Wolfgang (SP)
>Subject: convert rma.mv() output to data.frame
>
>Dear Wolfgang and list members,
>
>I am wondering if it is possible to convert the "Variance Components"
>part of the output of an rma.mv() object to data.frame (example
>below)?
>
>Many thanks,
>Simon
>
>library(metafor)
>dat <- dat.konstantopoulos2011
>
>res <- rma.mv(yi, vi, random = ~ factor(school) | district, data=dat)
>
>#Variance Components: Can we convert this part to a data.frame?
>
>#outer factor: district       (nlvls = 11)
>#inner factor: factor(school) (nlvls = 11)
>
>#            estim    sqrt  fixed
>#tau^2      0.0978  0.3127     no
>#rho        0.6653             no
>
>#Test for Heterogeneity:
>#Q(df = 55) = 578.8640, p-val < .0001


More information about the R-sig-meta-analysis mailing list