voodooochild@gmx.de
2006-Jan-12 10:56 UTC
[R] Software Reliability Using Cox Proportional Hazard
Hello, i want to use coxph() for software reliability analysis, i use the following implementation ####################################################################################### failure<-read.table("failure.dat", header=T) attach(failure) f<-FailureNumber t<-TimeBetweenFailure # filling vector f with ones for(i in 1:length(f)) { f[i]<-1 } library(survival) # cox proportional hazard with covariable LOC cox.res<-coxph(Surv(t,f)~LOC,data=failure) plot(survfit(cox.res)) ########################################################################################## failure.dat is FailureNumber TimeBetweenFailure LOC 1 7 120 2 11 135 3 8 141 4 10 150 5 15 162 6 22 169 7 20 170 8 25 181 9 28 188 10 35 193 here TimeBetweenFailure gives the time between following failures and LOC is the actuall Lines of Code. What i do, is filling the vector f with ones. f is then in Surv the censoring variable. in survival analysis the censoring variable is 1 if the patient dies, now i interpret the event death as the appearence of a failure. And i use LOC as covariable. My question now is, is this approach right or is there any big mistake or wrong interpretation? Thanks a Lot! best regards Andreas