bubble_plot not working
itchyshin opened this issue · 4 comments
I need to figure out why this does not work
the example in Help does work - so something else
mod_results(decline, mod = "cYear", group = "Study_ID", data = dat)
Error in ref_grid(result, ...) : Something went wrong:
Non-conformable elements in reference grid.
> # TODO this does not work - will get this working
> mod_results(decline, mod = "cYear", group = "Study_ID", data = dat)
Error in ref_grid(result, ...) : Something went wrong:
Non-conformable elements in reference grid.
'bubble_plot' is working now. But we need to change Help file to get ride of the data
argument
email from Gabriel Cotlier (@itchyshin - to reply and resolve)
Dear Prof. Shinichi Nakagawa and Dr Daniel Noble,
I could run the codes with my data following the examples in the links you provided me and work very well!!
The package is really good and helpful and it is indeed very useful for my project, is indeed a great package to have a great use of multivariate meta-analysis modeling and graphics.
However, the only issue I had is that when I tried to apply to my data the code for bubble plots, I got the problem that is k value was plotted in the wrong panel, somehow the k value is mismatched with the corresponding panel in which it should be automatically plotted.
So, due to this I decided to avoid plotting k in the bubble plot --which actually wes informative to have--by using the arguments k= F together with g= F, but k strongly still continued to plot in the graph. Please find below the code I use to implement the example in the tutorial to my data. I constructed a table with the same data structure in excel and loaded it. When I sorted the excel table according to "Year" in the first panel the k value was plotted correctly however the two other paneled had their k value swapped.
How can I make k and g values plotted in the correspondent panel. Or alternatively if not possible to omit ploting k and g in the bubble plot.
I will indeed appreciate your help and guidance.
Kind regards,
Gabriel
##################### ----CODE ----#############################
library(metafor)
library(orchaRd)
library(easycsv)
library(readxl)
library(ggplot2)
rm(list = ls())
dev.off()
## load data : the original input data "dat.xlsx" has only columns : "Author name"; "Year" "Pearson's r Correlation" and "Sample size"
dat <- read_excel(file.choose())
## Transformation of Pearson's Product-moment correlation coefficients (r) to Fisher's Z
dat <-escalc(measure = "ZCOR", ri = ri, ni = ni, data = dat)
View(dat)
dat[, "Year"] <- as.numeric(dat$Year)
dat$vi_1 <- 1/(dat$ni - 3)
model <- metafor::[rma.mv](http://rma.mv/)(yi = yi,
V = vi_1,
mods = ~Type * Year, random = list(~1 | Article, ~1 | Study_ID),
#data = na.omit(dat)
data = dat)
model
lim_bubble <- orchaRd::mod_results(model,
mod = "Year",
group = "Article",
weights = "prop",
by = "Type")
scaleFUN <- function(x) sprintf("%.f", x)
orchaRd::bubble_plot(lim_bubble,
group = "Article",
mod = "Year",
xlab = "Year",
legend.pos = "bottom.left",
k=TRUE,
g= TRUE,
condition.nrow = 3,
weights = "prop") +
scale_x_continuous(n.breaks = 10,labels=scaleFUN)
@daniel1noble - the bubble plot's number labelling inconsistencies fixed - can you please update orchaRd and let me know. I can test with the new version.