I would like to compile data from several published studies. I am trying to conduct a meta-regression using restricted cubic splines to analyse and plot the association between two variables (x and y), which is not linear.
Here's a simplified version of the code I used to fit the restricted cubic splines in the meta-regression:
library(metafor) spl <- rma(y, y_se, mods = ~ rcs(x, c(1,2,3,4,5)), data=data, method="DL", random = ~ 1 | id)
However, the estimates of the regression between the knots are very high (+1111) and low (-1826), when I expected much less variation (-2 to 2).
Model Results: estimate intrcpt 89.7615 rcs(x, c(1,2,3,4,5))x 14.0133 rcs(x, c(1,2,3,4,5))x ' -112.4379 rcs(x, c(1,2,3,4,5))x '' 1111.1094 rcs(x, c(1,2,3,4,5))x ''' -1826.6025
And when I plot these, it gives me also a very odd plot:
with(predict(spl, dose), plot(dose, pred, type = "l"))
Do you have an idea why? Is this because rcs() cannot be used with rma()? If this is the problem, what is the alternative to include a restricted cubic spline model within rma()?
Thanks in advance for your help!