Description Usage Arguments Value Author(s) References See Also Examples
Probability density and distribution function for the Royston/Parmar spline model.
1 2 3 4 | dsurvspline(x, gamma, beta=0, X=0, knots=c(-10,10), scale="hazard", offset=0)
psurvspline(q, gamma, beta=0, X=0, knots=c(-10,10), scale="hazard", offset=0)
hsurvspline(x, gamma, beta=0, X=0, knots=c(-10,10), scale="hazard", offset=0)
Hsurvspline(x, gamma, beta=0, X=0, knots=c(-10,10), scale="hazard", offset=0)
|
x,q |
Vector of times. |
gamma |
Vector of parameters describing the baseline spline
function, as described in |
beta |
Vector of covariate effects. |
X |
Matrix of covariate values. |
knots |
Locations of knots on the axis of log time, supplied in
increasing order. Unlike in |
scale |
|
offset |
An extra constant to add to the linear predictor eta. |
dsurvspline
gives the density, psurvspline
gives the distribution
function, hsurvspline
gives the hazard and Hsurvspline
gives the cumulative hazard, as described in flexsurvspline
.
Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>
Royston, P. and Parmar, M. (2002). Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects. Statistics in Medicine 21(1):2175-2197.
1 2 3 4 5 6 7 8 9 10 11 | ## reduces to the weibull
regscale <- 0.786; cf <- 1.82
a <- 1/regscale; b <- exp(cf)
dweibull(1, shape=a, scale=b)
dsurvspline(1, gamma=c(log(1 / b^a), a)) # should be the same
## reduces to the log-normal
meanlog <- 1.52; sdlog <- 1.11
dlnorm(1, meanlog, sdlog)
dsurvspline(1, gamma = c(-meanlog/sdlog, 1/sdlog), scale="normal")
# should be the same
|
Loading required package: survival
[1] 0.1137858
[1] 0.1137858
[1] 0.1407338
[1] 0.1407338
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.