Orsini, N. Weighted mixed-effects dose-response models for tables of correlated contrasts. Stata Journal. 2021, Vol.21 (2), p.320-347.
The pdf is available here
Orsini, N., and Spiegelman D. Meta-Analysis of Dose-Response Relationships. Chapter 18. Handbook of Meta-Analysis. Chapman and Hall/CRC, 2020. 395-428.
Crippa, A., Discacciati, A., Bottai, M., Spiegelman, D., Orsini, N (2019). One-stage dose–response meta-analysis for aggregated data. Statistical methods in medical research, 28(5), 1579-1596.
dosresmeta R package
Just type (once) at Stata command line ssc install drmeta
Tables of correlated empirical contrasts arising from heterogenous and possibly non-linear relationships investigated in experimental and observational studies
use http://www.stats4life.se/data/md_drm, clear
list id md dose semd n sd, sepby(id)
$ \begin{equation} \hat \gamma_{ij} = (\beta_1 + b_{1i}) x_{ij} + \epsilon_{ij} \end{equation} $
drmeta md dose, se(semd) data(n sd) id(id) type(type_md) ml
$ \begin{equation} \hat \gamma_{ij} = (\beta_1 + b_{1i})s_1(x_{ij}) + (\beta_2 + b_{2i})s_2(x_{ij}) + \epsilon_{ij} \label{eq:m_s} \end{equation} $
with three knots $\left(k_1, k_2, k_3\right)$, typically located at fixed percentiles of the dose distribution, the two splines are
$ \begin{align*} s_1(x_{ij}) &= x_{ij} \nonumber \\ s_2(x_{ij}) &= \frac{ \left(x_{ij} - k_1 \right)_{+}^3 - \frac{k_3 - k_1}{k_3 - k_2} \left(x_{ij} - k_2 \right)_{+}^3 + \frac{k_2 - k_1}{k_3 - k_2} \left(x_{ij} - k_3 \right)_{+}^3}{ (k_3 - k_1)^2} \end{align*} $
mkspline doses = dose, nk(3) cubic displayknots
mat knots = r(knots)
drmeta md doses1 doses2 , se(semd) data(n sd) id(id) type(type_md) ml
drmeta_graph , matk(knots) dose(2(.5)10) ref(5) name(figure2, replace) ///
ytitle("Mean Difference") list yline(0, lp(dot) lc(black)) xlabel(2(1)10) ylabel(#7) ///
addplot(-2*(d-5)+.2*(d^2-25)) plotopts(lc(blue))
use http://www.stats4life.se/data/or_drm, clear
list, sepby(id)
mkspline bmis = bmi, nk(3) cubic displayknots
mat knots = r(knots)
drmeta b bmis1 bmis2 , se(seb) data(n case) type(type) id(id) ml
drmeta_graph , matk(knots) dose(21(.2)28) list ref(24) ///
addplot(-2.3*(d-24)+0.05*(d^2-24^2)) ///
plotopts(lc(blue)) eform ///
ytitle("Adjusted Odds Ratio") ///
xtitle("Body Mass Index (kg/m{sup:2})") ///
name(fig4, replace) ylabel(1 1.2 1.5 2 3 4, angle(horiz))
use http://www.stats4life.se/data/hr_drm, clear
list, sepby(id)
$ \begin{equation} \hat \gamma_{ij} = (\beta_1 + b_{1i})(x_{ij}) + (\beta_2 + b_{2i})(x_{ij}>2)(x_{ij}-2) + \epsilon_{ij} \end{equation} $
// generate the degree-1 spline with a knot at 2
gen walkplus = (walk>2)*(walk-2)
drmeta b walk walkplus, se(seb) data(n case) type(type) id(id) ml
lincom walk*1/2, eform
lincom (walk+walkplus)*1/2, eform