1 回答

TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超8個(gè)贊
可以查看segmented包求拐點(diǎn)的例子。
R中運(yùn)行:
library(segmented)
?segmented
。。。。。。
#An example using the default method:
# Cox regression with a segmented relationship
## Not run:
library(survival)
data(stanford2)
o<-coxph(Surv(time, status)~age, data=stanford2)
os<-segmented(o, ~age, psi=40) #estimate the breakpoint in the age effect
summary(os) #actually it means summary.coxph(os)
plot(os) #it does not work
plot.segmented(os) #call explicitly plot.segmented() to plot the fitted piecewise lines
如圖,拐點(diǎn)已求出。
- 1 回答
- 0 關(guān)注
- 6035 瀏覽
添加回答
舉報(bào)