ins <- read.table("~/public_html/Insul.csv",sep=",",header=T)
attach(ins) ; names(ins)
kVolt <- as.factor(kV) # this is necesary to get separate KM curves.
insul.km <- survfit(Surv(tc2,cens2)~ kVolt,conf.type="log-log")
survfit(insul.km)
# find out how to use different line types, and try adding legends.
survdiff(Surv(tc2,cens2)~ kVolt)
# what is the pattern of observed versus expected?
# what does this suggest about the power of this test?
fail <- rep(1,length( t)) # a failure indicator for all times.
# for comparision: the full data.
plot(survfit(Surv(t/60,fail)~ kVolt,conf.type="log-log"),
xlab="Hours", main="Breakdown by voltage level")
# notice how functions can be nested.
survdiff(Surv(t,fail)~ kVolt)