Skip to content
Prev 58782 / 398502 Next

worked in R, but not in S-Plus

Hi, 

I wrote a function that worked well in R, but not in
S-Plus, can anyone suggest a solution?
{
	cox.fit <- coxph(Surv(time.cox, status.cox) ~ x,
na.action = na.exclude, method = "breslow")
	fit.zph<-cox.zph(cox.fit,transform='log')
	fit.zph$table[,3]
}

yyy is my data frame that contains survial time,
censor status and predictor variables.
When run in S-Plus, it gave the following error
message:

Problem in model.frame.coxph(fit): Object "x" not
found

If I remove the 2nd and 3rd lines inside the function,
it worked, so definitely something is wrong in passing
the coxph object into the cox.zph().

Thanks