Message-ID: <C5C9BEF5-607C-4C2F-9EC2-6A0B851868B6@uniklinik-freiburg.de>
Date: 2023-06-21T13:57:45Z
From: Guido Schwarzer
Subject: [R-meta] Help with estimate adjustment
In-Reply-To: <6F194625-D822-4A50-BB3A-592A83DA81B2@icloud.com>
Massimo,
You could either conduct a subgroup analysis (if your covariate has few different values) or a meta-regression. Here is a fictitious example.
library(meta)
dat <- data.frame(n = rep(100, 6), mean = 1:6, sd = rep(1, 6), age = runif(6, 40, 60))
dat$age.c <- dat$age - mean(dat$age)
dat$agecat <- factor(dat$age > 50, levels = c(FALSE, TRUE), labels = c("<= 50 years", "> 50 years"))
m <- metamean(n, mean, sd, data = dat)
m
# Subgroup analysis
update(m, subgroup = agecat)
# Subgroup analysis assuming a common between-study variance in subgroups
update(m, subgroup = agecat, tau.common = TRUE)
metareg(m, ~ agecat) # same result
# Meta-regression using continuous covariate
metareg(m, ~ age.c)
Best,
Guido