Functions for tidycrr objects

# S3 method for class 'tidycrr'
coef(object, ...)

# S3 method for class 'tidycrr'
vcov(object, ...)

# S3 method for class 'tidycrr'
model.matrix(object, ...)

# S3 method for class 'tidycrr'
model.frame(formula, ...)

# S3 method for class 'tidycrr'
terms(x, ...)

Arguments

...

not used

formula

a formula

x, object

a tidycrr object

Value

coef vector, model matrix, model frame, terms object

Examples

mod <- crr(Surv(ttdeath, death_cr) ~ age + grade, trial)
#> 11 cases omitted due to missing values

coef(mod)
#>         age     gradeII    gradeIII 
#> 0.005883633 0.060098918 0.430659453 

model.matrix(mod) %>% head()
#>   age gradeII gradeIII
#> 1  23       1        0
#> 2   9       0        0
#> 3  31       1        0
#> 5  51       0        1
#> 6  39       0        0
#> 7  37       1        0

model.frame(mod) %>% head()
#>    Surv(ttdeath, death_cr) age grade
#> 1                   24.00+  23    II
#> 2                   24.00+   9     I
#> 3                   24.00+  31    II
#> 5 16.43:death other causes  51   III
#> 6  15.64:death from cancer  39     I
#> 7                   24.00+  37    II

terms(mod)
#> Surv(ttdeath, death_cr) ~ age + grade
#> attr(,"variables")
#> list(Surv(ttdeath, death_cr), age, grade)
#> attr(,"factors")
#>                         age grade
#> Surv(ttdeath, death_cr)   0     0
#> age                       1     0
#> grade                     0     1
#> attr(,"term.labels")
#> [1] "age"   "grade"
#> attr(,"order")
#> [1] 1 1
#> attr(,"intercept")
#> [1] 1
#> attr(,"response")
#> [1] 1
#> attr(,".Environment")
#> <environment: 0x5595481575d0>