Hi everyone, I am attempting to use the R package 'rms' http://biostat.mc.vanderbilt.edu/wiki/Main/Rrms to implement a PH weibull model, using the pphsm() function. However, I get the following error, f.ph <- pphsm(f) Warning message: In pphsm(f) : at present, pphsm does not return the correct covariance matrix I tried simply running the example on page 117 of the manual, i.e. set.seed(1) S <- Surv(runif(100)) x <- runif(100) dd <- datadist(x); options(datadist='dd') f <- psm(S ~ x, dist="exponential") summary(f) # effects on log(T) scale f.ph <- pphsm(f) ## Not run: summary(f.ph) But I still got the above error message. I have looked through the R help archives, and it appears that this question has been asked before in 2011, but there were no replies. http://r.789695.n4.nabble.com/HELP-td3494640.html Does anyone know how to get this function to work? Or if there is an alternative package that can implement a Weibull PH model? Cheers, Lucy [[alternative HTML version deleted]]
Hello Lucy, If you carefully read, it is is not an error message, but a warning message. It tells you that for the moment, if I am not mistaken, "pphsm" does not return the correct covariance matrix, for any fitting. Regards, Pascal On Thu, Apr 3, 2014 at 11:29 AM, Lucy Leigh <lucy.leigh at newcastle.edu.au> wrote:> Hi everyone, > I am attempting to use the R package 'rms' > http://biostat.mc.vanderbilt.edu/wiki/Main/Rrms > to implement a PH weibull model, using the pphsm() function. > > However, I get the following error, > f.ph <- pphsm(f) > Warning message: > In pphsm(f) : > at present, pphsm does not return the correct covariance matrix > > I tried simply running the example on page 117 of the manual, i.e. > set.seed(1) > S <- Surv(runif(100)) > x <- runif(100) > dd <- datadist(x); options(datadist='dd') > f <- psm(S ~ x, dist="exponential") > summary(f) # effects on log(T) scale > f.ph <- pphsm(f) > ## Not run: summary(f.ph) > > But I still got the above error message. > I have looked through the R help archives, and it appears that this question has been asked before in 2011, but > there were no replies. > http://r.789695.n4.nabble.com/HELP-td3494640.html > > Does anyone know how to get this function to work? Or if there is an alternative package that can implement > a Weibull PH model? > Cheers, > Lucy > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Pascal Oettli Project Scientist JAMSTEC Yokohama, Japan
On 04/02/2014 10:29 PM, Lucy Leigh wrote:> Hi everyone, > I am attempting to use the R package 'rms' > http://biostat.mc.vanderbilt.edu/wiki/Main/Rrms > to implement a PH weibull model, using the pphsm() function. > > However, I get the following error, > f.ph <- pphsm(f) > Warning message: > In pphsm(f) : > at present, pphsm does not return the correct covariance matrix > > I tried simply running the example on page 117 of the manual, i.e. > set.seed(1) > S <- Surv(runif(100)) > x <- runif(100) > dd <- datadist(x); options(datadist='dd') > f <- psm(S ~ x, dist="exponential") > summary(f) # effects on log(T) scale > f.ph <- pphsm(f) > ## Not run: summary(f.ph) > > But I still got the above error message. > I have looked through the R help archives, and it appears that this question has been asked before in 2011, but > there were no replies. > http://r.789695.n4.nabble.com/HELP-td3494640.html > > Does anyone know how to get this function to work? Or if there is an alternative package that can implement > a Weibull PH model? > Cheers, > Lucy >Maybe I'm missing something, but since the AFT and PH models intersect in the weibull distribution, why not just use the psm() function to fit the parametric model. You can still obtain hazard ratio estimates from that model with a little bit of calculation (e.g. exp(-beta/scale)). -- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
On 04/03/2014 04:29 AM, Lucy Leigh wrote:> Hi everyone, > I am attempting to use the R package 'rms' > http://biostat.mc.vanderbilt.edu/wiki/Main/Rrms > to implement a PH weibull model, using the pphsm() function. > > However, I get the following error, > f.ph <- pphsm(f) > Warning message: > In pphsm(f) : > at present, pphsm does not return the correct covariance matrix > > I tried simply running the example on page 117 of the manual, i.e. > set.seed(1) > S <- Surv(runif(100)) > x <- runif(100) > dd <- datadist(x); options(datadist='dd') > f <- psm(S ~ x, dist="exponential") > summary(f) # effects on log(T) scale > f.ph <- pphsm(f) > ## Not run: summary(f.ph) > > But I still got the above error message. > I have looked through the R help archives, and it appears that this question has been asked before in 2011, but > there were no replies. > http://r.789695.n4.nabble.com/HELP-td3494640.html > > Does anyone know how to get this function to work? Or if there is an alternative package that can implement > a Weibull PH model?The function 'phreg' in the package 'eha' fits parametric PH models to right-censored and left-truncated data for some baseline distributions, among them the Weibull. G?ran Brostr?m> Cheers, > Lucy > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >