[R-meta] Calculating the var-covar matrix for dependent effect sizes for ROM
Michael Dewey
lists at dewey.myzen.co.uk
Wed Nov 8 13:19:35 CET 2017
Dear Jonas
I cannot answer your earlier questions but I think you have to roll your
own qqplot of the residuals for which there is an extractor function.
On 08/11/2017 08:19, Jonas Duus Stevens Lekfeldt wrote:
> Thank you, Wolfgang for the fast and clear reply!
>
> In an earlier reply by Wolfgang I found the following formula for calculating the covariance for ROM (log response ratio) when controls are shared among some of the datasets (if I have understood it correctly):
>
> Covariance = sd^2/(n*mean^2), from the group whose data is being re-used.
>
> I have calculated a new covariance column in the dataset data of the individual effect sizes based on the control data in the following way:
>
> data <- data %>%
> dplyr::mutate (covar=((data$sd2i)^2)/(data$n2i*(data$m2i^2))),
>
> where:
> sd2i is the standard deviation of the control group
> n2i is the sample size of the control group
> m2i is the mean of the control group
>
> Subsequently I have calculated the variance-covariance matrix (here called VarC) using the following code (again inspired by Wolfgang):
>
> calc.v.ROM <- function(x) {
> v <- matrix(x$covar[1],nrow=nrow(x),ncol=nrow(x))
> diag(v) <- x$vi
> v
> }
>
> covar_list <- lapply(split(data,data$ControlName),calc.v.ROM)
> VarC <- bldiag(covar_list)
>
>
> Where "ControlName" is the column in "data" where the names of the control groups are stored.
>
> Using VarC as the argument to V in the following code gives meaningful results so it seems to work, but I would like to ask if it seems correct?
>
> meta_list <- rma.mv(yi=data$yi,
> V=VarC,
> random = ~1|ExpName/ControlName/ID,
> test="t")
>
> Another question: drawing a qqnorm-plot does not seem to be implemented for rma.mv(). Is that right?
>
>
> Best regards
>
> Jonas Duus Stevens Lekfeldt
>
> _______________________________________________
> R-sig-meta-analysis mailing list
> R-sig-meta-analysis at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
>
--
Michael
http://www.dewey.myzen.co.uk/home.html
More information about the R-sig-meta-analysis
mailing list