tim@timcohn.com
2002-Nov-13 22:05 UTC
survreg (survival) reports erroneous results for left-censored data (PR#2287)
Full_Name: Tim Cohn Version: 1.6.1 OS: Macintosh OS X Submission from: (NULL) (130.11.34.250) The Mac version of survreg does not handle left-censored data correctly (at least the results are not what I get doing it other ways, and they are not the same as I get running R 1.6.1 in Windows 98se; the Windows 98 results are correct). On the windows version of R 1.6.1.> survreg(Surv(c(0,1,-1),c(T,T,F),type='left')~1,dist='gaussian')Call: survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ 1, dist = "gaussian") Coefficients: (Intercept) -0.2321569 Scale= 1.161135 Loglik(model)= -4.1 Loglik(intercept only)= -4.1 n= 3 ================ The Macintosh OS X result for the same command is:> survreg(Surv(c(0,1,-1),c(T,T,F),type='left')~1,dist='gaussian')Call: survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ 1, dist = "gaussian") Coefficients: (Intercept) -0.7373613 Scale= 1.366282 Loglik(model)= -5.6 Loglik(intercept only)= -5.6 n= 3 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jan de Leeuw
2002-Nov-14 01:47 UTC
survreg (survival) reports erroneous results for left-censored data (PR#2287)
Using R-1.6.1 on OS X (Darwin) Call: survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ 1, dist = "gaussian") Coefficients: (Intercept) -0.2321569 Scale= 1.161135 Loglik(model)= -4.1 Loglik(intercept only)= -4.1 n= 3 No problemo. And, in fact, I get the same results in the R-1.6.0 Carbon version. --- Jan On Wednesday, November 13, 2002, at 02:05 PM, tim@timcohn.com wrote:> Full_Name: Tim Cohn > Version: 1.6.1 > OS: Macintosh OS X > Submission from: (NULL) (130.11.34.250) > > > The Mac version of survreg does not handle left-censored data > correctly (at > least the results are not what I get doing it other ways, and they are > not the > same as I get running R 1.6.1 in Windows 98se; the Windows 98 results > are > correct). On the windows version of R 1.6.1. > >> survreg(Surv(c(0,1,-1),c(T,T,F),type='left')~1,dist='gaussian') > Call: > survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ > 1, dist = "gaussian") > > Coefficients: > (Intercept) > -0.2321569 > > Scale= 1.161135 > > Loglik(model)= -4.1 Loglik(intercept only)= -4.1 > n= 3 > > > ================> > The Macintosh OS X result for the same command is: > >> survreg(Surv(c(0,1,-1),c(T,T,F),type='left')~1,dist='gaussian') > Call: > survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ > 1, dist = "gaussian") > > Coefficients: > (Intercept) > -0.7373613 > > Scale= 1.366282 > > Loglik(model)= -5.6 Loglik(intercept only)= -5.6 > n= 3 > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > .-.-.-.-.- > r-devel mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: > r-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ > ._._._._ > >==Jan de Leeuw; Professor and Chair, UCLA Department of Statistics; Editor: Journal of Multivariate Analysis, Journal of Statistical Software US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554 phone (310)-825-9550; fax (310)-206-5658; email: deleeuw@stat.ucla.edu homepage: http://gifi.stat.ucla.edu ------------------------------------------------------------------------ ------------------------- No matter where you go, there you are. --- Buckaroo Banzai http://gifi.stat.ucla.edu/sounds/nomatter.au ------------------------------------------------------------------------ ------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Stefano Iacus
2002-Nov-16 08:48 UTC
survreg (survival) reports erroneous results for left-censored data (PR#2287)
Thomas, you were right. It works now. This is what I get with Carbon R and the patched survival package. I will upload a patched version of survivalLib. Can you please fix SurvS.h sources? Stefano > survreg(Surv(c(0,1,-1),c(T,T,F),type='left')~1,dist='gaussian') Call: survreg(formula = Surv(c(0, 1, -1), c(T, T, F), type = "left") ~ 1, dist = "gaussian") Coefficients: (Intercept) -0.2321569 Scale= 1.161135 Loglik(model)= -4.1 Loglik(intercept only)= -4.1 n= 3 On Saturday, November 16, 2002, at 12:59 AM, Thomas Lumley wrote:> > I think it's a problem with the erfc macro in survS.h, which is > defined > as > #ifndef erfc > #define erfc(x) 2*pnorm5(-x*M_SQRT2,0,1,1,0) > #endif > > The problem is that in survreg2.c we call erf(-z/ROOT_2), which > expands to > 2*pnorm5(--z/ROOT_2*SQRT2,0,1,1,0), and the -- becomes a predecrement > operator. I hate macros. > > If so, the fix would be > #ifndef erfc > #define erfc(x) 2*pnorm5(-(x)*M_SQRT2,0,1,1,0) > #endif > > -thomas > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Maybe Matching Threads
- survreg (survival) reports erroneous results for left-censored (PR#2291)
- survreg (survival) reports erroneous results for left-censored (PR#2293)
- Survreg(), Surv() and interval-censored data
- interval-censored data in survreg()
- survreg() provides same results with different distirbutions for left censored data