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!
__________________________________
row.names time status 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 -131.814868070704
68 92 0 -130.894209954078
69 89 0 -137.238790602832
70 92 0 -123.335580167768
71 90 0 -128.086747545075
72 89 0 -118.023792565249
73 81 0 -124.140112377933
74 89 0 -123.557718000736
75 87 0 -129.133025758546
76 84 0 -132.819677169905
77 93 0 -114.948509681572
78 93 0 -126.843731495767
79 90 0 -126.914473987314
80 91 0 -116.08396742567
81 92 0 -127.919623579223
82 81 0 -122.962735242548
83 83 0 -129.365323274863
84 83 0 -120.84026455158
85 83 0 -127.296772437868
86 76 0 -128.103814025141
87 80 0 -125.772468036654
88 77 0 -123.631618890831
89 74 0 -127.994432028251
90 73 0 -126.419070304427
91 72 0 -131.660097136739
92 68 0 -125.413233115966
93 68 0 -138.218431943486
94 78 0 -123.07982945469
95 73 0 -116.384063682613
96 70 0 -127.330150891079
97 67 0 -131.718316300226
98 66 0 -123.475670304613
99 65 0 -135.662159995207
100 61 0 -143.534838548891
101 83 0 -127.335641168471
102 83 0 -126.606139533895
103 82 0 -137.825810009011
104 100 0 -137.280521383395
105 59 0 -135.396275499849
106 137 0 -115.691277274203
107 8 1 -122.717642241355
108 270 0 -131.356024138003
109 35 0 -119.081849427549
110 259 0 -123.984779546206
111 24 1 -131.629690213802
112 116 0 -137.913216657882
113 77 0 -131.196957768821
114 204 0 -125.223651459961
115 86 0 -117.894392689136
116 190 0 -134.404173618817
117 35 0 -141.419935388768
118 60 0 -115.466639044415
119 153 0 -124.983013330182
120 82 0 -122.276101832036
121 65 1 -123.641085366617
122 76 0 -128.264185357202
123 161 0 -137.307710269989
124 245 0 -121.708141772266
125 159 0 -126.264383685031
126 43 0 -128.944995726045
127 239 0 -127.134264613079
128 88 0 -127.906885403694
129 74 0 -131.39696926786
130 230 0 -124.844937535032
131 256 0 -124.195488779877
132 261 0 -118.750861784276
133 68 0 -133.96615732231
134 251 0 -110.24805158707
135 206 0 -120.865459371524
136 7 1 -125.764322497762
137 41 0 -132.24058254327
138 193 0 -129.760134432563
139 61 0 -126.97880211218
140 231 0 -132.485754949864
141 9 1 -115.221983735737
142 245 0 -122.067899524035
143 95 0 -129.278499780569
144 219 0 -128.248169646623
145 158 0 -131.402717188798
146 80 0 -123.80255953996
147 220 0 -123.669023275273
148 179 0 -131.90562951679
149 216 0 -130.25778270429
150 192 0 -142.619028866821
151 85 0 -129.675915664178
152 191 0 -124.506440288497
153 117 0 -122.175062331521
154 124 0 -138.98511726923
155 190 0 -129.110002233
156 111 0 -133.972390212165
157 100 0 -121.227872960721
158 106 0 -127.227799134883
159 180 0 -131.638287205309
160 99 0 -127.092321006362
161 177 0 -118.237447594304
162 50 0 -135.254965739404
163 55 0 -133.936555206953
164 101 0 -127.199009342625
165 172 0 -123.315087711685
166 105 0 -138.360361025387
167 166 0 -128.816935143872
168 140 0 -114.164182633207
169 163 0 -116.990871141101
170 141 0 -115.790532063025
171 144 0 -122.062900573043
172 48 0 -124.352997578259
173 46 0 -127.286311504575
174 135 0 -114.873161268319
175 165 0 -125.278552411536
176 72 0 -129.177407051499
177 148 0 -119.574172881321
______________________________________________
[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