Fit/predict implementation of survival::survreg()
, which can return
absolutely continuous distribution predictions using distr6.
parametric(
formula = NULL,
data = NULL,
reverse = FALSE,
time_variable = "time",
status_variable = "status",
x = NULL,
y = NULL,
eps = 1e-15,
...
)
(formula(1))
Object specifying the model fit, left-hand-side of formula should describe a survival::Surv()
object.
(data.frame(1))
Training data of data.frame
like object, internally is coerced with stats::model.matrix()
.
(logical(1))
If TRUE
fits estimator on censoring distribution, otherwise (default) survival distribution.
(character(1))
Alternative method to call the function. Name of the 'time' variable, required if formula
.
or x
and Y
not given.
(character(1))
Alternative method to call the function. Name of the 'status' variable, required if formula
or x
and Y
not given.
(data.frame(1))
Alternative method to call the function. Required if formula, time_variable
and
status_variable
not given. Data frame like object of features which is internally
coerced with model.matrix
.
([survival::Surv()])
Alternative method to call the function. Required if formula, time_variable
and
status_variable
not given. Survival outcome of right-censored observations.
(numeric(1))
Used when the fitted scale
parameter is too small. Default 1e-15
.
ANY
Additional arguments passed to survival::survreg()
.
An object inheriting from class parametric
.
if (requireNamespaces(c("distr6", "survival"))) {
library(survival)
parametric(Surv(time, status) ~ ., data = simsurvdata(10))
}
#>
#> Parametric survival model
#>
#> Call:
#> parametric(formula = Surv(time, status) ~ ., data = simsurvdata(10))
#>
#> Response:
#> Surv(time, status)
#> Features:
#> {(Intercept), sexF, age, trt}