[R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Jacob Brogren
Hi, I ran the example on pp. 799-800 from Machael Crawley's The R Book using package survival v. 2.36-5, R 2.13.0 and RStudio 0.94.83. The model is a Cox's Proportional Hazards model. The result was quite different compared to the R Book. I have compared my code to the code in the book but can

Re: [R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread David Winsemius
On Jun 28, 2011, at 6:51 AM, Jacob Brogren wrote: Hi, I ran the example on pp. 799-800 from Machael Crawley's The R Book using package survival v. 2.36-5, R 2.13.0 and RStudio 0.94.83. The model is a Cox's Proportional Hazards model. The result was quite different compared to the R

Re: [R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Robert A LaBudde
Did you create the 'status' variable the way indicated on p. 797? Frequently with Surv() it pays to use syntax such as Surv(death, status==1) to make a clear logical statement of what is an event (status==1) vs. censored. PS. Next time include head(seedlings) and str(seedlings) to make

Re: [R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Jacob Brogren
Hi, sorry about that; here is the full output - data set, structure, model and result. Cheers Jacob seedlings cohort death gapsize status 1 September 7 0.5889 1 2 September 3 0.6869 1 3 September12 0.1397 1 4 September 1 0.1921 1 5 September

Re: [R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Jacob Brogren
All, I rerun once again and managed to reproduce the results from the text book. Made no changes to the code. Could it be some problem with convergence? Anyhow, now it works! Cheers Jacob ps. I find The R Book very useful ds. 28 jun 2011 kl. 15.48 skrev Robert A LaBudde: Did you create

Re: [R] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Ben Bolker
Jacob Brogren jacob at brogren.nu writes: All, I rerun once again and managed to reproduce the results from the text book. Made no changes to the code. Could it be some problem with convergence? It is possible, but *extremely* unlikely, to get non-deterministic results from R (i.e.