R/summary.flexsurvreg.R
normboot.flexsurvreg.RdProduce a matrix of alternative parameter estimates under sampling
uncertainty, at covariate values supplied by the user. Used by
summary.flexsurvreg for obtaining confidence intervals around
functions of parameters.
normboot.flexsurvreg(x, B, newdata = NULL, X = NULL, transform = FALSE, raw = FALSE)
| x | A fitted model from |
|---|---|
| B | Number of samples. |
| newdata | Data frame or list containing the covariate values to
evaluate the parameters at. If there are covariates in the model, at least
one of |
| X | Alternative (less convenient) format for covariate values: a
matrix with one row, with one column for each covariate or factor contrast.
Formed from all the "model matrices", one for each named parameter of the
distribution, with intercepts excluded, |
| transform |
|
| raw | Return samples of the baseline parameters and the covariate effects, rather than the default of adjusting the baseline parameters for covariates. |
If newdata includes only one covariate combination, a matrix
will be returned with B rows, and one column for each named
parameter of the survival distribution.
If more than one covariate combination is requested (e.g. newdata is
a data frame with more than one row), then a list of matrices will be
returned, one for each covariate combination.
Mandel, M. (2013). "Simulation based confidence intervals for functions with complicated derivatives." The American Statistician (in press).
fite <- flexsurvreg(Surv(futime, fustat) ~ age, data = ovarian, dist="exp") normboot.flexsurvreg(fite, B=10, newdata=list(age=50))#> rate #> [1,] 0.0001888545 #> [2,] 0.0003383161 #> [3,] 0.0003979311 #> [4,] 0.0002122192 #> [5,] 0.0001830719 #> [6,] 0.0001767790 #> [7,] 0.0008584380 #> [8,] 0.0002783924 #> [9,] 0.0002291624 #> [10,] 0.0003979303 #> attr(,"X") #> age #> 1 50 #> attr(,"X")attr(,"newdata") #> age #> 1 50#> rate #> [1,] 0.0000748700 #> [2,] 0.0003083860 #> [3,] 0.0003414101 #> [4,] 0.0003404276 #> [5,] 0.0003525359 #> [6,] 0.0002688899 #> [7,] 0.0001715434 #> [8,] 0.0005233337 #> [9,] 0.0008513980 #> [10,] 0.0001804580 #> attr(,"X") #> [,1] #> [1,] 50#> rate #> [1,] 2.856641e-06 #> [2,] 1.442188e-06 #> [3,] 3.864431e-07 #> [4,] 2.992903e-07 #> [5,] 3.348233e-07 #> [6,] 1.076838e-07 #> [7,] 2.684630e-07 #> [8,] 1.018824e-05 #> [9,] 2.213149e-07 #> [10,] 2.576992e-09 #> attr(,"X") #> age #> 1 0 #> attr(,"X")attr(,"newdata") #> age #> 1 0fite$res#> est L95% U95% se #> rate 8.883706e-07 1.444100e-08 5.465012e-05 1.867116e-06 #> age 1.185227e-01 5.216657e-02 1.848788e-01 3.385579e-02