Description Usage Arguments Value Examples
This function implements accelerated failure time regression models to estimate
the conditional survival, which is back-transformed to estimate the conditional mean.
It leverages the flexsurv
package to fit accelerated failure time models and
uses numerical integration to back-transform. The numerical integration step can
be unstable and we have tried to build in checks to guard against this. In particular, we
first try to integrate with upper limit = Inf, but if that fails move to 1e8,
which sometimes is able to provide a sane answer when upper limit = Inf fails.
The function keeps trying smaller and smaller values, but will not go smaller than 1e6.
In that case it returns a random number between 0 and randomUpper
(default is maxY
).
1 2 3 4 5 6 7 8 9 10 | SL.flexsurv(
Y,
X,
newX,
family,
obsWeights,
dist = "gengamma",
randomUpper = max(Y),
...
)
|
Y |
A numeric outcome variable |
X |
A |
newX |
A |
family |
Gaussian only |
obsWeights |
Observation-level weights (not currently used) |
dist |
Distribution for accelerated failure time model (defaults to generalized Gamma) |
randomUpper |
If numeric integration fails, for the purposes of stability while fitting
the |
pred
Predicted outcomes based on predictors in newX
fit
A list with named entries object
(the fitted flexsurv
model object),
randomUpper
.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.