zackfisher / robumeta Goto Github PK
View Code? Open in Web Editor NEWRobust Variance Meta-Regression
Robust Variance Meta-Regression
robu() appears to fail when there is only one effect per studynum. See the following example:
library(robumeta)
set.seed(20170120)
dat <- data.frame(study = factor(rep(LETTERS, each = 3)),
outcome = factor(1:3))
dat <- within(dat, {
d <- rnorm(26, sd = 0.3)[study] + rnorm(26 * 3, sd = 0.2)
V_d <- 4 / rpois(26, lambda = 30)[study]
})
# these work
robu(d ~ 1, var.eff.size = V_d, data = dat, studynum = study)
robu(d ~ 0 + outcome, var.eff.size = V_d, data = dat, studynum = study)
# fails
dat_single <- subset(dat, outcome == 1)
robu(d ~ 1, var.eff.size = V_d, data = dat_single, studynum = study)
# Error in (W/k)[1, 1] : incorrect number of dimensions
Hi there, I'm hoping this is the right place to inquire about this. I was trying to use the predict function to get estimates at different dummy-coded levels of my moderator and I just couldn't get it to work. I tried to run the example code in the help page and got the same error, which is:
Error in stats::qt(1 - (1 - level)/2, df) :
Non-numeric argument to mathematical function
I can't figure out what's wrong; I dummy-coded my variable appropriately and have specified the "pred.vector" in the way it's described on the help page (intercept, dummy codes) but I simply can't get it to work. I was wondering if even the example code doesn't run/produces the same error, could it be something in the actual code?
I'm happy to share more of my own code if needed. It would be so awesome if I could get some help figuring out what is happening. Thanks in advance for any help!!
Hi, I'm trying to use robumeta for my dissertation. I tried to create a forest plot with forest.robu but I keep getting this error "subscript out of bounds". What's even more confusing is that I've run this same code for two other sets of data and they both worked. I can't figure out what I am doing wrong here. I've checked my data and everything looks okay; no missing data, not issues with coding. In fact, everything that's coded in this dataset is similar to that of the other two dataset that ran with forest.robu.
Please advise.
forest.robu(z, es.lab = "DV", study.lab="Study", "Weights"=r.weights, "Hedges' g" = effect.size)
Error in col$values[[i]] : subscript out of bounds
In a meta-regression model with correlated effects (i.e., modelweights = "CORR"
), I get the same results no matter what value for rho
I specify. Shouldn't the results change depending on the value of rho
? Here is an example:
library(metafor)
library(robumeta)
dat <- dat.riley2003
dat$vi <- dat$sei^2
rhos <- seq(0, 1, by=.1)
res <- lapply(rhos, function(rho)
robu(yi ~ outcome - 1, data=dat, modelweights="CORR", studynum=study,
var.eff.size=vi, rho=rho, small=TRUE))
cbind(rho = sapply(res, function(x) c(x$mod_info$rho)),
tau2 = sapply(res, function(x) c(x$mod_info$tau.sq)))
This yields:
rho tau2
[1,] 0.0 0.4283492
[2,] 0.1 0.4283492
[3,] 0.2 0.4283492
[4,] 0.3 0.4283492
[5,] 0.4 0.4283492
[6,] 0.5 0.4283492
[7,] 0.6 0.4283492
[8,] 0.7 0.4283492
[9,] 0.8 0.4283492
[10,] 0.9 0.4283492
[11,] 1.0 0.4283492
Is this a bug or am I misunderstanding how the method works?
Hey,
Thanks a lot for developing this tool! It's super useful and easy explained! I have one minor issue: When I plot an intercept-only model such as in the example with the oswald data using forest.robu, the plot often displays only a subset of studies. Also when I zoom or export it, it doesn't allow to see all studies and the graph looks as if it was cut off at the top and bottom. It is probably something fairly simple and not necessarily related to robumeta itself, but I couldn't find a solution for it. I was hoping you might know what could resolve this issue.
Thanks a lot & best wishes,
Annika
hi, i also met problems with forest plot, my problem is that i can not plot. i tried the data provided by R in _robumeta_packages, the code ran well but the plot didn't come out. i don't know if it is because i do not install any packages. now i installed metafor, robumeta and grid.
many thanks
Dear Team,
I used your robumeta package for a meta-analysis. Today, I tried to reproduce the results of the meta-analysis, however, I´m unable to do so. The R code I used last year seems to not work anymore. According to your package documentation on CRAN, the name of the predict() command did not change.
I can create my robumeta object with the robu command, but when I try to use:
ES_P1 <- predict (res_2, pred.vector = c(1, 1), level = 0.95)
it now returns:
Error in stats::qt(1 - (1 - level)/2, df) :
Non-numerical argument for mathematical function.
If I try to use robumeta::predict(), it tells me that robumeta did not export this object. Do you know what´s happening here?
Best,
Max
Thank you for a fantastic package.
We have a dataset with the correlations between young children's response times (RT) & socioeconomic status (SES), on the one hand; and accuracies & socioeconomic status on the other; collected with 3 tests (LwL, PPVT, TVT). Some studies report both RT & accuracy for the same group of children; most report only one.1 RTs are available for LwL & TVT (only one study has RTs for PPVT).
Here's our data: mwe.csv
We:
escalc
from metafor
to get yi=zcor & viThe following models fit, but I cannot get the forest plot out:
robu_fit_base <- robu(yi ~ 1, data = mydat,
modelweights = "HIER", studynum = infant_group,
var.eff.size = vi)
forest.robu(robu_fit_base)
robu_fit_age <- robu(yi ~ age.min, data = all,
modelweights = "HIER", studynum = infant_group,
var.eff.size = vi)
robu_fit_age_exp <- robu(yi ~ age.min*expected, data = all,
modelweights = "HIER", studynum = infant_group,
var.eff.size = vi)
robu_fit_age_test <- robu(yi ~ age.min*comp_measure_cat, data = all,
modelweights = "HIER", studynum = infant_group,
var.eff.size = vi)
"omega.sq is the between-studies-within-cluster variance component for the hierarchical effects meta-regression model." It is zero in all of these models. It's not impossible that our measures are super noisy to the point that there is no systematic variance attributed to the repeated measures. Is that the right interpretation?
"tau.sq is the between-cluster variance component in the hierarchical effects model". This is very small in all of these models. So studies do not vary systematically very much. Is that the right interpretation?
metafor
also provides a test for heterogeneity and I^2 (total heterogeneity / total variability), which gives us an idea of the extent to which we still have variance to explain. Given that omega.sq is so small, would it be reasonable to fit the models using metafor
so as to be able to report to our readers/reviewers these results on heterogeneity?
We flipped the direction of the correlation for RTs (faster is better), so that higher correlation indicates stronger relationship for both RTs and accuracy. We use the column "expected" to separate RTs from accuracies -- expected== positive --> accuracy; expected ==negative --> RT. ↩
Dear team,
Thank you for your work on this intuitive package! Currently, I experience an issue when I try to plot the results of the example provided. When I run the code for the Oswald example no plot is created and when I assign it to an object and run it results in the following: "NULL". I could not find any solution online, am I missing something here?
I installed the grid & clubSandwich packages and tried something that was suggested in another issue:
forest.robu(oswald_intercept, es.lab = "Crit.Cat", study.lab = "Study", "Effect Size" = effect.size, "Weight" = r.weights)
dev.copy(png, "myForestPlot.png", width=450, height=900, units="px", res=72)
dev.off()
Running this results in the following:
quartz_off_screen
3
quartz_off_screen
2
I hope that you have any suggestions on how to fix this.
Kind regards,
Jur
@windshield999 @zackfisher Commit 7e76317 introduces an error (and inefficiencies) into the small-sample correction formula. See my comments on the commit.
The following source link provided in the documentation is no longer valid:
https://my.vanderbilt.edu/emilytannersmith/training-materials/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.