[R] using Hmisc and Design library

array chip arrayprofile at yahoo.com
Wed Dec 15 01:14:30 CET 2004


Hi, I encountered a weird problem when using the
Design and Hmisc problem. I have 2 data frame called
"a" and "b", both have 3 columns: "time", "status" and
"scores", a sample of the data frame is like:

data frame "a":
  time status scores 
1   21      1  99.61
2   38      0 101.11
3   51      0 100.62
4   48      0  87.52
5   78      0  97.18

data frame "b":
  time status scores 
1   27      0 -126.7
2   24      0 -135.6
3   30      0 -139.5
4   49      0 -137.6
5   27      0 -136.9

when I ran the following using data frame "a",
everything is ok.

> library(Hmisc,T);library(Design,T)
> dd <- datadist(a)
> options(datadist='dd')
> fit <- cph(Surv(time,status) ~ scores,
data=a,surv=T, x=T, y=T)
> fit
Cox Proportional Hazards Model

cph(formula = Surv(time, status) ~ scores, data =
data.combined.testing.set.scores, x = T, y = T,
	surv = T)

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

  85     31       7.47    1 0.0063  7.21  0.0072 0.088


         coef se(coef)    z       p 
scores 0.0766   0.0287 2.67 0.00752


but when I ran the same script using data frame "b",
even though no error message was produced, no fit
object was generated:

> rm(fit)
> library(Hmisc,T);library(Design,T)
> dd <- datadist(a)
> options(datadist='dd')
> fit <- cph(Surv(time,status) ~ scores,
data=a,surv=T, x=T, y=T)
> fit
Problem: Object "fit" not found, while calling
subroutine S_agsurv2 
Use traceback() to see the call stack

can anyone tell me why? no missing value is present in
either data frame.

Thanks




More information about the R-help mailing list