I'm trying to run InfluenceAnalysis from the {dmetar} library and have done so successfully today however with a new data set I keep getting the error 'Object 'x' must be of class meta. I have ran class() on the meta item and it's returning [1] "metamean" "meta" and so I'm lost as to what is the argument. Forgive my Rcode as I'm an absolute novice.
library(meta)
library(metafor)
library(dmetar)
library(tidyverse)
A basic version of the data would be
dat <- data.frame( author = c("study1", "study2", "study3", "study4"),
n.e = c(10, 80, 42, 50),
mean.e = c(120, -23, 10, 11),
sd.e = c(26.5, 26.5, 26.5, 26.5),
overall_rob = c("+", "-", "?", "?")
I then placed in {metamean}
dat.mean <- metamean(n=n.e,
mean=mean.e,
sd=sd.e,
studlab=author,
data = dat,
subgroup = overall_rob, subgroup.name = "Risk of Bias", control=NULL)
dat.mean
I then added predictions
dat.gen <- update(dat.mean, prediction = TRUE)
I then attempt to run InfluenceAnalysis
dat.inf <- InfluenceAnalysis(dat.gen, random = TRUE)
then the following error returns
Error in InfluenceAnalysis(meta, random = TRUE) :
Object 'x' must be of class 'meta', 'metabin', 'metagen', 'metacont', 'metacor', 'metainc', or 'metaprop'
so I have ran class(dat.gen) which returned the following
[1] "metamean" "meta"
so I'm lost