首页 > 编程知识 正文

cox回归分析的不足,怎么用cox分析有意义的变量建模

时间:2023-05-05 20:53:12 阅读:228755 作者:2820

参考链接:http://finzi.psych.upenn.edu/R/library/My.stepwise/html/My.stepwise.coxph.html

package

install.packages("My.stepwise")

Usage My.stepwise.coxph(Time = NULL, tzdgk, fdgq, Status = NULL, variable.list, in.variable = "NULL", data, sle = 0.15, sls = 0.15, vif.threshold = 999) Arguments Time

The 'Time' (time to an event) for the sepcified Cox's proportional hazards model as in coxph().

T1

The 'T1' (Start) of the long-form data for the sepcified Cox's model as in coxph().

T2

The 'T2' (Stop) of the long-form data for the sepcified Cox's model as in coxph().

Status

The 'Status' (event indicator) for the sepcified Cox's proportional hazards model as in coxph().

variable.list

A list of covariates to be selected.

in.variable

A list of covariate(s) to be always included in the regression model.

data

The data to be analyzed.

sle

The chosen significance level for entry (SLE).

sls

The chosen significance level for stay (SLS).

vif.threshold

The chosen threshold value of variance inflating factor (VIF).

Examples ## Not run: The data 'lung' is available in the 'survival' package.## End(Not run)if (requireNamespace("survival", quietly = TRUE)) { lung <- survival::lung}names(lung)dim(lung)my.data <- na.omit(lung)dim(my.data)head(my.data)my.data$status1 <- ifelse(my.data$status==2,1,0)my.variable.list <- c("inst", "age", "sex", "ph.ecog", "ph.karno", "pat.karno")My.stepwise.coxph(Time = "time", Status = "status1", variable.list = my.variable.list, in.variable = c("meal.cal", "wt.loss"), data = my.data)my.variable.list <- c("inst", "age", "sex", "ph.ecog", "ph.karno", "pat.karno", "meal.cal", "wt.loss")My.stepwise.coxph(Time = "time", Status = "status1", variable.list = my.variable.list, data = my.data, sle = 0.25, sls = 0.25)

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。