autoRegCox: perform automatic regression for a class of coxph

View source: R/autoReg.coxph.R

autoRegCoxR Documentation

perform automatic regression for a class of coxph

Description

perform automatic regression for a class of coxph

Usage

autoRegCox(
  x,
  threshold = 0.2,
  uni = FALSE,
  multi = TRUE,
  final = FALSE,
  imputed = FALSE,
  keepstats = FALSE,
  ...
)

Arguments

x

An object of class coxph

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

...

Further arguments to be passed to gaze()

Value

autoRegCox 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" or "coxph"

Examples

require(survival)
require(dplyr)
data(cancer)
fit=coxph(Surv(time,status==2)~log(bili)+age+cluster(edema),data=pbc)
autoReg(fit)
fit=coxph(Surv(time,status)~rx+age+sex+nodes+obstruct+perfor,data=colon)
autoReg(fit)
autoReg(fit,uni=TRUE,threshold=1)
autoReg(fit,uni=TRUE,final=TRUE) %>% myft()
data(colon_s,package="finalfit")
fit=coxph(Surv(time,status)~age.factor+sex.factor+obstruct.factor+perfor.factor,data=colon_s)
autoReg(fit,uni=TRUE,threshold=1)
autoReg(fit,uni=TRUE,imputed=TRUE)

autoReg documentation built on Nov. 14, 2023, 9:07 a.m.