1

生存パッケージを使用して 2 つの母集団の KM 曲線を生成していますが、xmax パラメータを定義しようとすると、x 軸の範囲を 0 ~ 15 から 0 ~ 50 に拡張できません。

これが私のコードです:

 library(sm)
library(survival)
comb = read.csv("S:/Novocure/ChemoSKTime2Resp.csv", head = TRUE)
comb
survobj = with(comb, Surv(SK.response.time,Censored))
survobj

# Compare the survival distributions of nonresponders(0) and responders(1)

fitresp = survfit(survobj ~ response, data=comb)
fitresp
summary(fitresp)

# plot the survival distributions by response

plot(fitresp, xlab="Tumor Progression Time in Months", 
  ylab="% Progressed", yscale=100, col=c("red","blue"),
  main="Chemo Time to Tumor Progression Distribution", xmax = 50) 
  legend("topright", title="Chi-sq = 5.2, P = 0.0222", 
  c("Non-responders", "Responders"), fill=c("red", "blue"))
4

1 に答える 1

3

へのxmax引数plot.survfitは、x 軸の範囲を短縮するだけのようです。拡張するには、xlim代わりに次の引数を使用します。

plot(fitresp, xlab="Tumor Progression Time in Months", 
  ylab="% Progressed", yscale=100, col=c("red","blue"),
  main="Chemo Time to Tumor Progression Distribution", xlim = c(0,50))
于 2012-11-01T17:12:46.607 に答える