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)> fitCox 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)> fitProblem: 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
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 dataset, or the first 166 rows plus 168th row, .... the data in those rows 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 please advise! --- array chip <arrayprofile at yahoo.com> wrote:> 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 > > > __________________________________ >--------------------------------------------------------------------> This message was distributed by > s-news at lists.biostat.wustl.edu. To > unsubscribe send e-mail to > s-news-request at lists.biostat.wustl.edu with>__________________________________ Dress up your holiday email, Hollywood style. Learn more.
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)> fitProblem: 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)> fitCox 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