| Title: | Pool Literature-Based and Individual Participant Data Based Spline Estimates | 
| Version: | 0.1.0 | 
| Author: | Tommi Härkänen [aut, cre] | 
| Maintainer: | Tommi Härkänen <tommi.harkanen@thl.fi> | 
| Depends: | R (≥ 4.2.0) | 
| Description: | Pooling estimates reported in meta-analyses (literature-based, LB) and estimates based on individual participant data (IPD) is not straight-forward as the details of the LB nonlinear function estimate are not usually reported. This package pools the nonlinear IPD dose-response estimates based on a natural cubic spline from lm or glm with the pointwise LB estimates and their estimated variances. Details will be presented in Härkänen, Tapanainen, Sares-Jäske, Männistö, Kaartinen and Paalanen (2025) "Novel pooling method for nonlinear cohort analysis and meta-analysis estimates: Predicting health outcomes based on climate-friendly diets" (under revision) https://journals.lww.com/epidem/pages/default.aspx. | 
| License: | GPL (≥ 3) | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.3.2 | 
| Imports: | rlang, dplyr, tidyr, tibble, stringr, meta, optimization | 
| Suggests: | knitr, rmarkdown, splines2 | 
| VignetteBuilder: | knitr | 
| NeedsCompilation: | no | 
| Packaged: | 2025-07-17 05:14:38 UTC; thah | 
| Repository: | CRAN | 
| Date/Publication: | 2025-07-21 08:50:02 UTC | 
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)
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. | 
Value
List containing pooled estimates of the spline parameters.
Examples
# 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)
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_splines(
  v,
  meta.df,
  glm.res,
  cor.m = NULL,
  x.range = NULL,
  full.output = FALSE
)
Arguments
| v | Name of the covariate, which is modeled using an  | 
| meta.df | Meta-analysis estimates: dataframe with columns  | 
| glm.res | Regression analysis result object. | 
| cor.m | Assumed correlation matrix. If NULL (default) or NA then use correlation matrix from  | 
| x.range | If NULL (default), then take the range from  | 
| full.output | If TRUE then output also the log HR values and 95% confidence intervals over a grid of covariate values. | 
Value
List containing pooled estimates of the spline parameters.