[R] cph() in Design package

array chip arrayprofile at yahoo.com
Tue Apr 11 19:56:59 CEST 2006


Hi there, I encountered a weird problem using cph()
with Design package:

I have 2 datasets, say "dat1" and "dat2", both data
frames with 3 columns "time","status" and "scores",
all numeric

If I run the following:
dd<-datadist(dat1)
options(datadist='dd')
dd

                 time status   scores 
     Low:effect  37.0      0   -6.018
      Adjust to  88.0      0   11.252
    High:effect 109.0      1   33.267
 Low:prediction  11.0      0  -34.419
High:prediction 147.5      1   88.218
            Low   5.0      0  -72.072
           High 171.0      1  154.678

fit <- cph(Surv(time,status) ~ scores,
data=dat1,surv=T, x=T, y=T)
fit

Cox Proportional Hazards Model

cph(formula = Surv(time, status) ~ scores, data = xx,
x = T, y = T, surv = T)

 Obs Events Model L.R. d.f.      P Score Score P    R2

 171     64      10.65    1 0.0011 12.01  0.0005 0.062

so everything is ok.

However, if I run the following with the second
dataset:

dd<-datadist(dat2)
options(datadist='dd')
dd

                  time status   scores 
     Low:effect  68.10      0  -16.036
      Adjust to  91.75      0    9.068
    High:effect 119.03      1   42.447
 Low:prediction  21.75      0  -48.103
High:prediction 120.00      1   96.661
            Low   6.90      0  -75.392
           High 120.00      1  141.524

fit <- cph(Surv(time,status) ~ scores,
data=dat2,surv=T, x=T, y=T)
fit

Problem: Object "fit" not found, while calling
subroutine S_agsurv2 
Use traceback() to see the call stack

traceback()
4: eval(action, sys.parent())
3: doErrorAction("Problem: Object \"fit\" not found,
while calling subroutine S_agsurv2", 1000)
2: eval(expression(fit))
1: 
Message: Problem: Object "fit" not found, while
calling subroutine S_agsurv2

so it didn't work with the second dataset. The 2
dataset is very similar in terms of column data type. 

any suggestions?

Many thanks




More information about the R-help mailing list