> lymphoma.df time status 1 1 1 2 2 1 3 2 1 4 2 0 5 3 1 6 5 1 7 6 1 8 7 0 9 8 1 10 16 0 11 17 1 12 34 0 > Surv(lymphoma.df$time,lymphoma.df$status) [1] 1 2 2 2+ 3 5 6 7+ 8 16+ 17 34+ > lymphoma.surv_survfit(Surv(time,status), data=lymphoma.df) > summary(lymphoma.surv) Call: survfit(formula = Surv(time, status), data = lymphoma.df) time n.risk n.event survival std.err lower 95% CI upper 95% CI 1 12 1 0.917 0.0798 0.7729 1.000 2 11 2 0.750 0.1250 0.5410 1.000 3 8 1 0.656 0.1402 0.4318 0.997 5 7 1 0.562 0.1482 0.3356 0.943 6 6 1 0.469 0.1503 0.2501 0.879 8 4 1 0.352 0.1517 0.1509 0.819 17 2 1 0.176 0.1456 0.0347 0.891 > *** Nonparametric Survival *** Call: survfit(formula = Surv(time, status, type = "right") ~ 1, data = lymphoma.df, na.action = na.exclude, conf.int = 0.95, se.fit = T, type = "fleming-harrington", error = "greenwood", conf.type = "log", conf.lower = "usual") time n.risk n.event survival std.err lower 95% CI upper 95% CI 1 12 1 0.920 0.0801 0.7757 1.000 2 11 2 0.767 0.1278 0.5533 1.000 3 8 1 0.677 0.1446 0.4454 1.000 5 7 1 0.587 0.1546 0.3501 0.984 6 6 1 0.497 0.1593 0.2650 0.931 7 5 0 0.497 0.1593 0.2650 0.931 8 4 1 0.387 0.1669 0.1661 0.901 16 3 0 0.387 0.1669 0.1661 0.901 17 2 1 0.235 0.1944 0.0463 1.000 34 1 0 0.235 0.1944 0.0463 1.000 *** Nonparametric Survival *** Call: survfit(formula = Surv(time, status, type = "right") ~ 1, data = lymphoma.df, na.action = na.exclude, conf.int = 0.95, se.fit = T, type = "kaplan-meier", error = "tsiatis", conf.type = "log", conf.lower = "usual") time n.risk n.event survival std.err lower 95% CI upper 95% CI 1 12 1 0.917 0.0764 0.7785 1.000 2 11 2 0.750 0.1149 0.5555 1.000 3 8 1 0.656 0.1298 0.4454 0.967 5 7 1 0.562 0.1372 0.3487 0.907 6 6 1 0.469 0.1385 0.2627 0.836 7 5 0 0.469 0.1385 0.2627 0.836 8 4 1 0.352 0.1361 0.1647 0.751 16 3 0 0.352 0.1361 0.1647 0.751 17 2 1 0.176 0.1111 0.0509 0.607 34 1 0 0.176 0.1111 0.0509 0.607 *** Nonparametric Survival *** Call: survfit(formula = Surv(time, status, type = "right") ~ 1, data = lymphoma.df, na.action = na.exclude, conf.int = 0.95, se.fit = T, type = "kaplan-meier", error = "tsiatis", conf.type = "log-log", conf.lower = "usual") time n.risk n.event survival std.err lower 95% CI upper 95% CI 1 12 1 0.917 0.0764 0.5663 0.987 2 11 2 0.750 0.1149 0.4417 0.904 3 8 1 0.656 0.1298 0.3475 0.845 5 7 1 0.562 0.1372 0.2669 0.778 6 6 1 0.469 0.1385 0.1965 0.703 7 5 0 0.469 0.1385 0.1965 0.703 8 4 1 0.352 0.1361 0.1154 0.603 16 3 0 0.352 0.1361 0.1154 0.603 17 2 1 0.176 0.1111 0.0288 0.426 34 1 0 0.176 0.1111 0.0288 0.426 > lymphoma.surv_survfit(Surv(time,status), data=lymphoma.df) > lymphoma.surv1_survfit(Surv(time,status),type="fleming-harrington",error="greenwood",data=lymphoma.df) > plot(lymphoma.surv,lty=2,xlab="Time",ylab="SurvProb") > lines(lymphoma.surv1,conf.int=T,lty=1,lwd=2) > legend(20,0.65,c("FH","KM"),lty=1:2) > lymphoma.surv2_survfit(Surv(time,status),type="kaplan-meier",error="tsiatis",conf.type="log-log",data=lymphoma.df) > plot(lymphoma.surv1,lty=2,xlab="Time",ylab="SurvProb") > lines(lymphoma.surv2,conf.int=T,lty=1,lwd=2) > legend(20,0.65,c("KM-Ts-LogLog","FH-Gre-Log"),lty=1:2) > > survdiff(Surv(time,status)~group,data=leukemia.df,rho=0) Call: survdiff(formula = Surv(time, status) ~ group, data = leukemia.df, rho = 0) N Observed Expected (O-E)^2/E (O-E)^2/V group=Maintained 11 7 10.69 1.27 3.4 group=Nonmaintained 12 11 7.31 1.86 3.4 Chisq= 3.4 on 1 degrees of freedom, p= 0.0653 > survdiff(Surv(time,status)~group,data=leukemia.df,rho=1) Call: survdiff(formula = Surv(time, status) ~ group, data = leukemia.df, rho = 1) N Observed Expected (O-E)^2/E (O-E)^2/V group=Maintained 11 3.85 6.14 0.859 2.78 group=Nonmaintained 12 7.18 4.88 1.081 2.78 Chisq= 2.8 on 1 degrees of freedom, p= 0.0955 > survdiff(Surv(time,status)~group,data=leukemia.df,rho=0.5) Call: survdiff(formula = Surv(time, status) ~ group, data = leukemia.df, rho = 0.5) N Observed Expected (O-E)^2/E (O-E)^2/V group=Maintained 11 5.05 7.85 0.994 3.02 group=Nonmaintained 12 8.66 5.87 1.330 3.02 Chisq= 3 on 1 degrees of freedom, p= 0.0823