Skip to contents

Derive a normal prior for the log hazard scale parameter based on a guess at survival times. The scale parameter is hard to interpret, and depends on the spline knots. However for any scale parameter, we can determine the spline coefficients that give a constant hazard (mspline_constant_coefs). Therefore if we can guess a typical survival time, we can guess a typical hazard (as 1 divided by the survival time) and deduce the scale parameter. The prior is then constructed by assuming normality on the log scale, and assuming the log upper credible limit is two SDs away from the log median.


p_meansurv(median, upper, mspline = NULL)



Best guess (prior median) for a typical survival time


Upper limit of 95% credible interval for a survival time


A list with components knots (vector of knots), degree (polynomial degree) and bsmooth (logical for smoothness constraint at boundary), defining an M-spline configuration.


A normal prior in the format returned by p_normal, which can be passed directly to the prior_hscale argument in survextrap.