0

是否可以为三次样条分析设置参考组(设置危险比等于 1.0)?我正在使用 R 来输出受限三次样条模型,并且热衷于将参照组设置为包括我的 X 值 7 和 8。

我的代码如下。

mfit = coxph(Surv(FLUP,Dx) ~ pspline(exposure) + x1 + x2 +
           x3 + x4 + x5 + x6 + x7, data=new)
termplot(mfit, terms = 1, se= TRUE, col.term=1, col.se=1)
ptemp = termplot(mfit,se=TRUE,plot=FALSE)
attributes(ptemp)
newterm = ptemp$exposure
center = with(newterm, y[x==8])
ytemp = newterm$y + outer(newterm$se, c(0,-1.96,1.96),'*')
matplot(newterm$x, exp(ytemp - center), log="y",
    type = "l", lty = c(1,2,2), col=1,
    xlab = "Exposure", ylab = "Adjusted Hazards Ratio",
    main = "Restricted Cubic Spline")
4

0 回答 0