# Estimate a linear regression model using an individual participant data (IPD):
library(metasplines)
library(splines2)
res <- lm(
Petal.Width ~
Species +
nsk(Sepal.Length, Boundary.knots = c(4.5, 7.5), knots = c(5, 6, 6.5)),
data=iris)
# "Literature-based" (LB) estimates:
lb.df <- read.table(text=
"variable, cov.value, est, est.var
Sepal.Length, 4.5, 0, 0
Sepal.Length, 5, 0.15, 0.01
Sepal.Length, 5.5, 0.25, 0.01
Sepal.Length, 6, 0.4, 0.01
Sepal.Length, 6.5, 0.5, 0.01
Sepal.Length, 8, 0.25, 0.04
", sep=",", header=TRUE)
# Output table with the point estimates and the estimated variances:
pool_splines(v="Sepal.Length", meta.df=lb.df, glm.res=res)
Run the code above in your browser using DataLab