[R] using Hmisc and Design library

2004-12-15 Thread array chip
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 PR2 
 166 36  29.081 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!







__ 


row.names   timestatus  scores
1   27  0   -126.706775142792
2   24  0   -135.646938397462
3   30  0   -139.508762843248
4   49  0   -137.551209881948
5   27  0   -136.868192376342
6   41  0   -135.331913852558
7   31  0   -131.954779047339
8   27  0   -131.524681661997
9   37  0   -131.786118789511
10  38  1   -98.9746000656833
11  29  1   -105.533478698214
12  31  1   -112.317311438571
13  49  1   -106.60935095037
14  51  0   -127.040652771522
15  53  0   -125.818847128221
16  76  0   -122.973527977967
17  77  0   -129.84742262956
18  41  0   -126.759206020033
19  62  0   -124.688165345946
20  52  0   -121.724878244943
21  83  0   -127.065353492987
22  10  1   -105.019394502807
23  60  0   -126.590791227224
24  56  0   -128.398971375234
25  43  0   -122.109019588711
26  17  1   -98.1976727902452
27  107 0   -126.545160192436
28  21  1   -121.472686960897
29  38  0   -120.93978698714
30  51  0   -117.109857031147
31  48  0   -133.322549387909
32  78  0   -124.877928079306
33  55  0   -128.908553897764
34  53  0   -130.185734686138
35  10  1   -115.375584653794
36  5   1   -116.131928609306
37  21  1   -116.453942436335
38  24  1   -123.020079653056
39  24  1   -131.311964779875
40  24  1   -117.748209513549
41  37  0   -127.985941925825
42  53  0   -124.534919208761
43  54  1   -138.345612101095
44  35  1   -121.365208594489
45  60  0   -133.593779020529
46  69  0   -130.449420655907
47  74  0   -135.183874932554
48  48  0   -139.167445404491
49  54  0   -130.900766393426
50  55  0   -115.834160342219
51  69  0   -124.397447684606
52  17  1   -115.232780851337
53  24  1   -123.652687449155
54  24  1   -113.79362358954
55  14  1   -125.077495747215
56  15  1   -123.39550171375
57  6   1   -120.703960854828
58  27  1   -122.593559899788
59  19  1   -115.508773940805
60  35  1   -131.602555921887
61  68  1   -115.631506755249
62  42  1   -128.315195343203
63  47  1   -123.511731764928
64  13  1   -127.655777153564
65  25  1   -123.503248471324
66  15  1   -121.266145049005
67  44  1   

[R] using Hmisc and Design library

2004-12-14 Thread array chip
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 PR2

  85 31   7.471 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

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html