为了账号安全,请及时绑定邮箱和手机立即绑定

R语言如何使用segmented包求拐点?

R语言如何使用segmented包求拐点?

ibeautiful 2019-02-07 11:07:27
R语言如何使用segmented包求拐点
查看完整描述

1 回答

?
慕森卡

TA贡献1806条经验 获得超8个赞

可以查看segmented包求拐点的例子。

R中运行:

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

如图,拐点已求出。


查看完整回答
反对 回复 2019-03-07
  • 1 回答
  • 0 关注
  • 5360 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信