Define a Restricted Cubic Spline Survival Distribution
Source:R/survival_define.R
define_surv_spline.Rd
Define a restricted cubic spline parametric survival distribution.
Usage
define_surv_spline(scale = c("hazard", "odds", "normal"), ...)
Arguments
- scale
"hazard", "odds", or "normal", as described in flexsurvspline. With the default of no knots in addition to the boundaries, these models reduce to the Weibull, log-logistic and log-normal respectively. The scale must be common to all times.
- ...
Additional distribution parameters (see respective distribution help pages).
Examples
define_surv_spline(
scale = "hazard",
gamma = c(-18.3122, 2.7511, 0.2292),
knots=c(4.276666, 6.470800, 7.806289)
)
#> $distribution
#> [1] "survspline"
#>
#> $scale
#> [1] "hazard"
#>
#> $gamma
#> [1] -18.3122 2.7511 0.2292
#>
#> $knots
#> [1] 4.276666 6.470800 7.806289
#>
#> attr(,"class")
#> [1] "surv_dist" "surv_object"
define_surv_spline(
scale = "odds",
gamma = c(-18.5809, 2.7973, 0.2035),
knots=c(4.276666, 6.470800, 7.806289)
)
#> $distribution
#> [1] "survspline"
#>
#> $scale
#> [1] "odds"
#>
#> $gamma
#> [1] -18.5809 2.7973 0.2035
#>
#> $knots
#> [1] 4.276666 6.470800 7.806289
#>
#> attr(,"class")
#> [1] "surv_dist" "surv_object"