[R-meta] Meta-analysis in R when there is no sampling variances
Viechtbauer Wolfgang (SP)
wolfgang.viechtbauer at maastrichtuniversity.nl
Fri Jun 30 20:13:16 CEST 2017
You cannot just replace 'vi' with 'wi'. Sampling variances and weights are different things.
As I suggested, calculate approximate sampling variances if that's the best thing that can be done. Use those for the 'V' argument (the second argument -- the one that you are currently misusing for specifying weights).
Since you have a multilevel structure, the bootstrapping needs to account for this. It would require considerable thought to implement this correctly.
An alternative is (still) to use robust(), using 'site_id' as the clustering variable.
Best,
Wolfgang
-----Original Message-----
From: Resham Thapa [mailto:reshambt1 at gmail.com]
Sent: Friday, June 30, 2017 19:39
To: Viechtbauer Wolfgang (SP)
Cc: r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] Meta-analysis in R when there is no sampling variances
ATTACHMENT(S) REMOVED: data_eg.csv
Dear Dr. Wolfgang,
Thank you for your quick response.
In my dataset, I have sample size (replications) and means for both treatment and control groups. With that, I am calculating the log response ratio (lrr) as an effect size. Yes, most of the articles in my search have not reported SD or CV. I found that many researchers in my field prefer to weight effect sizes using Wi=(Nt*Nc)/(Nt+Nc); where Nt and Nc are replicates for treatment and control groups. Here is one link of a paper:
https://www.researchgate.net/publication/315379724_Increased_plant_uptake_of_native_soil_nitrogen_following_fertilizer_addition_-_not_a_priming_effect ( Increased plant uptake of native soil nitrogen following fertilizer addition – not a priming effect?).
My understanding is:
1. We can replace 'vi' with 'wi' and conduct the meta-analysis. Also, I think multiple effect sizes from the study and multiple studies from the same site will be more correlated with each other. To account for this, I need to perform multi-level meta-analysis using random statement as outlined in your website. So, my code looks like:
library(metafor)
dat <- read.csv('C:/Users/resham.thapa/Desktop/data_eg.csv') dat
# Calculating weighted effect size with multiple, nested location/study/year as random effects.
res <- rma.mv(lrr, wi, random = ~ 1|site_id/study_id/site_year/com_control, data=dat, method="REML")
res
Is this correct?
2. Then, I need to perform non-parametric bootstrapping by slightly modifying the codes from your website. However, I always get error while running it. Any suggestions.
library(boot)
boot.func <- function(dat, indices) {
res <- try(rma.mv(lrr, wi, random = ~ 1|site_id/study_id/site_year/com_control, data=dat, method="REML", subset=indices), silent=TRUE)
if (is.element("try-error", class(res))) {
NA
} else {
c(coef(res), vcov(res), res$sigma)
}
}
res.boot <- boot(dat, boot.func, R=4999)
## There were 50 or more warnings (use warnings() to see the first 50)
warnings()
# 'V' appears to be not positive definite.
boot.ci(res.boot, index=1:2)
I have attached a subset of my data to illustrate about the nature of my data-set more clearly. Thank you in advance.
Regards'
Resham
More information about the R-sig-meta-analysis
mailing list