Hi, I am using clogit() from survival package to do conditional logistic 
regression. I also need to make prediction on an independent dataset to 
calculate predicted probability. Here is an example:


> dat <- data.frame(set=rep(1:50,each=3), status=rep(c(1,0,0),50), 
> x1=rnorm(150,5,1), x2=rnorm(150,7,1.5))
> dat.test <- data.frame(set=rep(1:30,each=3), status=rep(c(1,0,0),30), 
> x1=rnorm(90,5,1), x2=rnorm(90,7,1.5))
> fit<-clogit(status~x1+x2+strata(set),dat)
> predict(fit,newdata=dat.test,type='expected')
Error in Surv(rep(1, 150L), status) : 
  Time and status are different lengths

Can anyone suggest what's wrong here?

Thanks!

John
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to