[R] using Hmisc and Design library
array chip
arrayprofile at yahoo.com
Wed Dec 15 20:43:17 CET 2004
Hi all,
I encountered a weird problem when using the
Design and Hmisc libraries in S-Plus (it worked well
in R). I have a data frame called "b", which
has 3 columns: "time", "status" and
"scores", a sample of the data frame is like:
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 script using this data frame,
even though no error message was produced, no fit
object was generated:
> library(Hmisc,T);library(Design,T)
> dd <- datadist(b)
> options(datadist='dd')
> fit <- cph(Surv(time,status) ~ scores,
data=b,surv=T, x=T, y=T)
> fit
Problem: Object "fit" not found, while calling
subroutine S_agsurv2
Use traceback() to see the call stack
actually data frame "b" has 177 rows, the script ran
ok on the first 166 rows as a subset, but started to
break down if subset of the first 177 rows were used
as the input, or the first 166 rows plus 168th row,
....
the data in those rows in "b" are:
time status scores
165 172 0 -123.3
166 105 0 -138.4
167 166 0 -128.8
168 140 0 -114.2
169 163 0 -117.0
170 141 0 -115.8
Additionally, even if I only ran the script on the
first 166 rows, I still can't generate a plot:
> dd <- datadist(bbb[1:166,])
> options(datadist='dd')
> fit <- cph(Surv(time,status) ~ scores,
data=bbb[1:166,],surv=T, x=T, y=T)
> fit
Cox Proportional Hazards Model
cph(formula = Surv(time, status) ~ scores, data =
bbb[1:166, ], x = T, y = T, surv = T)
Obs Events Model L.R. d.f. P Score Score P R2
166 36 29.08 1 0 35.37 0 0.182
coef se(coef) z p
scores 0.102 0.0172 5.94 2.91e-009
> plot(fit, scores=seq(-140, -100, by=1),
time=36,fun=function(x) 1-x,xlim=c(-140,
-100),ylim=c(0,1),lwd=3,xlab='Scores',ylab='Probability
at 3 Years')
no error message, but only a blank graph window is
produced.
can anyone please tell me why this happens only in
S-Plus, but not in R? no missing value is present in
either data frame. the data "b" is attached in case
you need to run the script.
Thanks very much!
__________________________________
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: b.txt
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20041215/8b4952f7/b.txt
More information about the R-help
mailing list