Skip to contents

Residuals for a fitted spbp model.

Usage

# S3 method for class 'spbp'
residuals(
  object,
  type = c("martingale", "deviance", "cox-snell", "coxsnell"),
  ...
)

Arguments

object

an object of class `spbp` result of a spbp fit.

type

type of residuals, default is "cox-snell"

...

arguments passed to parent method.

See also

Examples


library("spsurv")
data("veteran", package = "survival")
#> Warning: data set ‘veteran’ not found

fit <- bpph(Surv(time, status) ~ karno + factor(celltype),
  data = veteran
)

residuals(fit)
#>            1            2            3            4            5            6 
#>  0.620355305 -0.677763319 -0.233596483  0.308411163  0.526283630  0.841100965 
#>            7            8            9           10           11           12 
#>  0.186314769  0.677333138 -1.298648204 -0.397584194  0.789672141  0.932088933 
#>           13           14           15           16           17           18 
#> -1.009768966 -0.064601942  0.962812829  0.695190917 -3.401799392  0.930100064 
#>           19           20           21           22           23           24 
#>  0.689260562  0.874137431 -2.617582245 -1.095069394 -0.757299758 -0.614833444 
#>           25           26           27           28           29           30 
#>  0.281493867  0.603528197 -1.365189088  0.781213344  0.676610462  0.612745494 
#>           31           32           33           34           35           36 
#>  0.388110472  0.141782280  0.498506215  0.801706997  0.593438515 -2.209402620 
#>           37           38           39           40           41           42 
#>  0.551287931  0.457266058  0.249422687  0.727797798  0.576257869  0.909369653 
#>           43           44           45           46           47           48 
#>  0.066773121 -7.387883894  0.821681747  0.605445108 -0.135712627 -0.002298556 
#>           49           50           51           52           53           54 
#> -0.075726180 -0.218962002  0.763550784 -0.496968156  0.893342101  0.137858678 
#>           55           56           57           58           59           60 
#> -0.840701368  0.333964169 -1.222874650 -2.292038565 -1.071583479  0.856540874 
#>           61           62           63           64           65           66 
#> -0.044046658  0.184566572  0.124901681 -0.546735976  0.568573218  0.573054967 
#>           67           68           69           70           71           72 
#>  0.581710309 -0.371481068  0.246339502 -1.304268736  0.671136949 -0.250932941 
#>           73           74           75           76           77           78 
#> -1.702954416 -0.779104322 -3.157127756  0.555766504  0.984592689 -2.415990555 
#>           79           80           81           82           83           84 
#>  0.155351573  0.589513623  0.584589763 -0.421650533 -0.053602599  0.410627786 
#>           85           86           87           88           89           90 
#>  0.993924094  0.892888142  0.778718823  0.401900553  0.904508920  0.364292980 
#>           91           92           93           94           95           96 
#> -0.856300388  0.279876441  0.680837101  0.026236934  0.965295419  0.498506215 
#>           97           98           99          100          101          102 
#>  0.770179137  0.759991526  0.179192532  0.959016924  0.484553738  0.515605952 
#>          103          104          105          106          107          108 
#>  0.816161729  0.214741814 -0.212151658 -0.376267303  0.453483044  0.331797074 
#>          109          110          111          112          113          114 
#>  0.507355386 -0.413217535  0.745770458  0.187434758 -0.512390089  0.169952852 
#>          115          116          117          118          119          120 
#> -0.204175633  0.844406438  0.592487364 -2.585461631  0.814966582 -0.764935943 
#>          121          122          123          124          125          126 
#> -0.254627951  0.245302409  0.617538693 -0.317568776 -1.474762280  0.630692784 
#>          127          128          129          130          131          132 
#>  0.080771646  0.683566047  0.622897794  0.753160465  0.700024220 -0.372340645 
#>          133          134          135          136          137 
#>  0.361759650  0.157911098 -0.273015981 -0.547887113  0.122546492