[R-meta] Changing reference level dose-response association

Stens, Niels N|e|@@Sten@ @end|ng |rom r@dboudumc@n|
Thu Jul 7 10:54:17 CEST 2022

Dear members of the R Sig Meta-analysis community,

I am currently performing a meta-analysis on the association between step count versus mortality and the incidence of cardiovascular diseases in the general population. For this, I have modelled a non-linear dose response association with cubic splines (see down below for reproducible example). Within the analysis I would ideally change the reference level. For example, current reference levels in the analysis are ~7000 and ~5000 steps/day for mortality and incident CVD respectively, but ideally I want to change this to the same reference level (e.g. 2500 steps/day). I have tried performing this using datadist (from rms package), but this did not change the reference level. How can I achieve this?


steps_day = seq(1500, 16000, 500) #number of steps someone takes on a day, ranging from 1500 to 16000, split up per 500 step increment
lnHR_AC = runif(1, 0, 1.5)*exp(-runif(1,0.01,0.05)*steps_day) + rnorm(30, 0, 0.5) #ln-transformed hazard ratios for all-cause mortality
SE_AC = rnorm(lnHR_AC, 0.5) #corresponding SE
lnHR_CVD = runif(1, 0, 1.5)*exp(-runif(1,0.01,0.05)*steps_day) + rnorm(30, 0, 0.5) - 0.25 #ln-transformed hazard ratios for cardiovascular diseases
SE_CVD = rnorm(lnHR_CVD, 0.6) #corresponding SE

dat = data.frame(steps_day, lnHR_AC, SE_AC, lnHR_CVD, SE_CVD) #make dataframe

#All-cause Mortality
xs <- seq(1500, 16000, length=30) #range of step counts, per 500 step increment
knots = quantile(dat$steps_day, p = c(0.05, 0.5, 0.95)) #specify the number and location of knots
res.rcs_AC <- rma(yi = lnHR_AC, sei = SE_AC, mods = ~rcs(steps_day, knots), data= dat, method = "REML") #create cubic spline object

#change reference level
#ddist = datadist(dat$steps_day)
#ddist$limits["Adjust to",2500]
#options(datadist = "ddist")

layout(matrix(c(1,2),1,2, byrow = TRUE))

plot(dat$steps_day, dat$lnHR_AC, col="white", xlab="Steps per day", ylab="Hazard Ratio", main="Cubic Spline Model for Mortality", ylim = c(0, 2), xlim = c(0, 15000)) #for making empty plot

sav_AC <- predict(res.rcs_AC, newmods=rcspline.eval(xs, knots = knots, inclx=TRUE), transf = exp)
polygon(c(xs, rev(xs)), c(sav_AC$ci.lb, rev(sav_AC$ci.ub)), col=rgb(0,0,0,.2), border=NA)
lines(xs, sav_AC$pred, lwd=3)

res.rcs_CVD <- rma(yi = lnHR_CVD, sei = SE_CVD, mods = ~rcs(steps_day, knots), data=dat, method = "REML")

plot(dat$steps_day, dat$lnHR_CVD, col="white", xlab="Steps per day", ylab="Hazard Ratio", main="Cubic Spline Model for CVD", ylim = c(0, 2)) #for making empty plot

sav_CVD <- predict(res.rcs_CVD, newmods=rcspline.eval(xs, knots = knots, inclx=TRUE), transf = exp)
polygon(c(xs, rev(xs)), c(sav_CVD$ci.lb, rev(sav_CVD$ci.ub)), col=rgb(0,0,0,.2), border=NA)
lines(xs, sav_CVD$pred, lwd=3)

Many thanks in advance.

Kind regards,

Niels Stens, MSc
PhD candidate, departments of Cardiology and Physiology, Radboud University Medical Center, Nijmegen, The Netherlands

De informatie in dit bericht is uitsluitend bestemd voor de geadresseerde. Aan dit bericht en de bijlagen kunnen geen rechten worden ontleend. Heeft u deze e-mail onbedoeld ontvangen? Dan verzoeken wij u het te vernietigen en de afzender te informeren. Openbaar maken, kopi?ren en verspreiden van deze e-mail of informatie uit deze e-mail is alleen toegestaan met voorafgaande schriftelijke toestemming van de afzender. Het Radboudumc staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 80262783.

The content of this message is intended solely for the addressee. No rights can be derived from this message or its attachments. If you are not the intended recipient, we kindly request you to delete the message and inform the sender. It is strictly prohibited to disclose, copy or distribute this email or the information inside it, without a written consent from the sender. Radboud university medical center is registered with the Dutch Chamber of Commerce trade register with number 80262783.

	[[alternative HTML version deleted]]

More information about the R-sig-meta-analysis mailing list