简体   繁体   English

如何在 R 中获取仅拦截 cox ph 模型,这在生存包中意味着什么?

[英]How to get for an intercept only cox ph model in R and what does that mean in the survival package?

一个人如何设置参数以使其仅在生存包或其他情况下拦截,以及关于 cox 比例风险模型,拦截仅真正意味着什么。

The standard way in R regression formulas to make what I would call a "null model" rather than an "intercept-only" model is to use ~1 as the only term. R 回归公式中制作我称之为“空模型”而不是“仅截取”模型的标准方法是使用~1作为唯一术语。 (Turns out that you can also use ~0 as the only term.) In survival models the "intercept" is the baseline hazard (the estimate against which all the covariate estimates are referenced to), which in the the survival package can be found for models containing covariates using the basehaz function. (事实证明,您也可以使用~0作为唯一的术语。)在生存模型中,“截距”是基线风险(所有协变量估计值都参考的估计值),可以在survival包中找到对于包含使用basehaz函数的协变量的模型。 So an "intercept only" Cox model, if I understand your intent, would just be the unadjusted Kaplan-Meier estimate.因此,如果我理解您的意图,“仅拦截”Cox 模型将只是未经调整的 Kaplan-Meier 估计。

 test1 <- list(time=c(4,3,1,1,2,2,3),   # example code ?coxph
               status=c(1,1,1,0,1,1,0), 
               x=c(0,2,1,1,1,0,0), 
               sex=c(0,0,0,0,1,1,1)) 
 # Fit a stratified model 
 nullfit <- coxph(Surv(time, status) ~ 0, test1) # Null model
 survfit( nullfit)
# ----
Call: survfit(formula = nullfit)

     n events median 0.95LCL 0.95UCL
[1,] 7      5      3       2      NA
# ----
 png(); plot( survfit( nullfit) ); dev.off()

在此处输入图像描述

Without any other context, an "intercept only" model, is just the mean.没有任何其他上下文,“仅拦截”模型只是平均值。 Basically, if you are doing a regression of y over x, the intercept only model is a flat line at the mean value of y (at all values at x).基本上,如果您在 x 上对 y 进行回归,则仅截距模型是 y 平均值处的一条平线(在 x 处的所有值处)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM