楼主: 冰小二
23663 13

[问答] R语言中生存分析的“~1”代表什么意思 [推广有奖]

11
xuwenpku 发表于 2018-6-6 09:04:06
"a formula object, which must have a Surv object as the response on the left of the ~ operator and, if desired, terms separated by + operators on the right. One of the terms may be a strata object. For a single survival curve the right hand side should be ~ 1."
这个是survfit()中对formula的解释。10楼说的是对的,如果只有一条生存曲线,~右侧应该是1,如果按照某一个分层变量做多个生存曲线则~右侧就是分层变量,比如按性别分层做两条曲线就可以是~sex。

12
hifinecon 发表于 2018-6-6 09:45:11
great discussion

13
ntsean 发表于 2018-6-8 12:11:35
类似一般的regression 模型 ~1就是只有intercept, 没有自变量

14
到底怎么弄 发表于 2019-1-25 01:12:25
请教一下,~.  表示什么?谢谢~~~~~~

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 00:15