perform automatic regression for a class of survreg
Usage
autoRegsurvreg(
x,
threshold = 0.2,
uni = FALSE,
multi = TRUE,
final = FALSE,
imputed = FALSE,
keepstats = FALSE,
mode = 1,
...
)
Arguments
- x
An object of class survreg
- threshold
numeric
- uni
logical whether or not perform univariable regression
- multi
logical whether or not perform multivariable regression
- final
logical whether or not perform stepwise backward elimination
- imputed
logical whether or not perform multiple imputation
- keepstats
logical whether or not keep statistic
- mode
integer
- ...
Further arguments to be passed to gaze()
Value
autoRegsurvreg returns an object of class "autoReg" which inherits from the class "data.frame" with at least the following attributes:
- attr(*,"yvars)
character. name of dependent variable
- attr(*,"model")
name of model. One of "lm","glm","coxph" or "survreg"
Examples
require(survival)
require(dplyr)
data(cancer)
fit=survreg(Surv(time,status)~rx+age+sex+nodes+obstruct+perfor,data=colon)
autoReg(fit)
#> —————————————————————————————————————————————————————————————————————————————————
#> Dependent: Surv(time, status) stats ETR (multivariable)
#> —————————————————————————————————————————————————————————————————————————————————
#> rx Obs 630 (33.9%)
#> Lev 620 (33.4%) 1.10 (0.91-1.31, p=.323)
#> Lev+5FU 608 (32.7%) 1.78 (1.46-2.18, p<.001)
#> age Mean ± SD 59.8 ± 11.9 1.00 (0.99-1.00, p=.499)
#> sex Mean ± SD 0.5 ± 0.5 1.09 (0.93-1.27, p=.289)
#> nodes Mean ± SD 3.7 ± 3.6 0.89 (0.88-0.91, p<.001)
#> obstruct Mean ± SD 0.2 ± 0.4 0.77 (0.63-0.93, p=.007)
#> perfor Mean ± SD 0.0 ± 0.2 0.74 (0.49-1.14, p=.171)
#> —————————————————————————————————————————————————————————————————————————————————
autoReg(fit,uni=TRUE,threshold=1)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dependent: Surv(time, status) stats ETR (univariable) ETR (multivariable)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————
#> rx Obs 630 (33.9%)
#> Lev 620 (33.4%) 1.04 (0.86-1.25, p=.683) 1.10 (0.91-1.31, p=.323)
#> Lev+5FU 608 (32.7%) 1.79 (1.46-2.20, p<.001) 1.78 (1.46-2.18, p<.001)
#> age Mean ± SD 59.8 ± 11.9 1.00 (1.00-1.01, p=.394) 1.00 (0.99-1.00, p=.499)
#> sex Mean ± SD 0.5 ± 0.5 1.03 (0.88-1.21, p=.701) 1.09 (0.93-1.27, p=.289)
#> nodes Mean ± SD 3.7 ± 3.6 0.89 (0.88-0.91, p<.001) 0.89 (0.88-0.91, p<.001)
#> obstruct Mean ± SD 0.2 ± 0.4 0.74 (0.61-0.90, p=.003) 0.77 (0.63-0.93, p=.007)
#> perfor Mean ± SD 0.0 ± 0.2 0.71 (0.45-1.10, p=.124) 0.74 (0.49-1.14, p=.171)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————
autoReg(fit,uni=TRUE,final=TRUE)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dependent: Surv(time, status) stats ETR (univariable) ETR (multivariable) ETR (final)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> rx Obs 630 (33.9%)
#> Lev 620 (33.4%) 1.04 (0.86-1.25, p=.683) 1.10 (0.92-1.32, p=.304) 1.10 (0.91-1.31, p=.324)
#> Lev+5FU 608 (32.7%) 1.79 (1.46-2.20, p<.001) 1.78 (1.45-2.17, p<.001) 1.77 (1.45-2.17, p<.001)
#> age Mean ± SD 59.8 ± 11.9 1.00 (1.00-1.01, p=.394)
#> sex Mean ± SD 0.5 ± 0.5 1.03 (0.88-1.21, p=.701)
#> nodes Mean ± SD 3.7 ± 3.6 0.89 (0.88-0.91, p<.001) 0.90 (0.88-0.91, p<.001) 0.90 (0.88-0.91, p<.001)
#> obstruct Mean ± SD 0.2 ± 0.4 0.74 (0.61-0.90, p=.003) 0.77 (0.63-0.93, p=.007) 0.76 (0.62-0.92, p=.004)
#> perfor Mean ± SD 0.0 ± 0.2 0.71 (0.45-1.10, p=.124) 0.76 (0.50-1.16, p=.196)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
autoReg(fit,uni=TRUE,final=TRUE) %>% myft()
Dependent: Surv(time, status)
stats
ETR (univariable)
ETR (multivariable)
ETR (final)
rx
Obs
630 (33.9%)
Lev
620 (33.4%)
1.04 (0.86-1.25, p=.683)
1.10 (0.92-1.32, p=.304)
1.10 (0.91-1.31, p=.324)
Lev+5FU
608 (32.7%)
1.79 (1.46-2.20, p<.001)
1.78 (1.45-2.17, p<.001)
1.77 (1.45-2.17, p<.001)
age
Mean ± SD
59.8 ± 11.9
1.00 (1.00-1.01, p=.394)
sex
Mean ± SD
0.5 ± 0.5
1.03 (0.88-1.21, p=.701)
nodes
Mean ± SD
3.7 ± 3.6
0.89 (0.88-0.91, p<.001)
0.90 (0.88-0.91, p<.001)
0.90 (0.88-0.91, p<.001)
obstruct
Mean ± SD
0.2 ± 0.4
0.74 (0.61-0.90, p=.003)
0.77 (0.63-0.93, p=.007)
0.76 (0.62-0.92, p=.004)
perfor
Mean ± SD
0.0 ± 0.2
0.71 (0.45-1.10, p=.124)
0.76 (0.50-1.16, p=.196)
if (FALSE) {
autoReg(fit,mode=2)
autoReg(fit,uni=TRUE,threshold=1,,mode=2)
autoReg(fit,uni=TRUE,final=TRUE,mode=2)
autoReg(fit,uni=TRUE,final=TRUE,mode=2) %>% myft()
autoReg(fit,final=TRUE,imputed=TRUE) %>% myft()
autoReg(fit,final=TRUE,imputed=TRUE,mode=2) %>% myft()
}