I am new to coding so I hope I provide all the info necessary to answer this question! I am making a meta regression using the meta package in R and using the bubble function to plot it. I have 173 points to plot, however, it is only displaying 2 points from my dataset on the graph and I'm not sure why.
It says:
In bubble.metareg(m.gen.reg, studlab = TRUE, :
Only first covariate in meta-regression ('population_density') considered in bubble plot. No regression line plotted.
I'm not sure what that means and haven't found a way to display all my points. If you know what that message means or how to fix it I'd greatly appreciate it.
Image of graph currently being produced
Here is my code:
library(tidyverse)
library(dplyr)
library(meta)
library(stringr)
library(tidyr)
#took my large dataset and made it smaller to work with
small_dataset_2 <- read.csv("FirstRegressionData.csv",stringsAsFactors = F) %>%
select(Author,Location,Date,value,Lower_Confidence_Limits, Upper_Confidence_Limits,Density_km2) %>%
mutate(Stand_err =((Upper_Confidence_Limits - value)/1.96)) %>%
na.omit("small_dataset_2")
#object used for meta analysis
m.gen <- metagen (TE = small_dataset$value,
seTE = Stand_err,
studlab = Location,
data = small_dataset,
comb.fixed = FALSE,
comb.random = TRUE,
overall.hetstat = TRUE,
method.tau = "REML")
population_density <- small_dataset_2$Density_km2
m.gen.reg <- metareg(m.gen, ~population_density)
m.gen.reg
bubble(m.gen.reg,
studlab = TRUE,
xlim = c(1,500),
ylim = c(0,18),
regline = TRUE,
xlab = ("x-axis"),
ylab = ("y-axis"),
col.line = "blue"
)
The instructions for the meta package state about the bubble function you are using (bubble.metareg in the instructions):
It is a scatter plot with the treatment effect for each study on the y-axis and the covariate used in the meta-regression.
I emphasized the to denote only one covariate is identified. So my guess is that metareg is not generating the expected object for bubble.
When you print m.gen.reg, does it resemble the following from section 8.2 of the Doing Meta Analysis in R online book?
Also, metagen is used on small_dataset, which is not defined anywhere. I instead see small_dataset_2.