"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。