Learn R Programming

metasplines (version 0.1.0)

pool_all_splines: Title Pool meta-analysis estimates and estimates from a regression model.

Description

Title Pool meta-analysis estimates and estimates from a regression model.

Usage

pool_all_splines(v, meta.df, glm.res)

Value

List containing pooled estimates of the spline parameters.

Arguments

v

Name of the covariate, which is modeled using an nsk spline.

meta.df

Meta-analysis estimates: dataframe with columns variable (covariate name), est (log HR estimate), est.var (estimated variance) and cov.value (covariate values where est and est.var were reported).

glm.res

Regression analysis result object.

Examples

Run this code
# 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