一个人如何设置参数以使其仅在生存包或其他情况下拦截,以及关于 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. (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. So an "intercept only" Cox model, if I understand your intent, would just be the unadjusted Kaplan-Meier estimate.
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).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.