I was wondering if someone familiar with survival analysis can help me with the following. I would like to fit a Weibull curve, that may be dependent on a covariate, my dataframe "labdata" that has the fields "cov", "time", and "censor". Do I do the following? wieb<-survreg(Surv(labdata$time, labadata$censor)~labdata$cov, dist="weibull") This returns:> weibCall: survreg(formula = Surv(labdata$time, labdata$censor) ~ labdata$cov, dist = "weibull") Coefficients: (Intercept) labdata$cov 8.091955112 0.001552897 Scale= 0.7532474 Loglik(model)= -12633.6 Loglik(intercept only)= -12734.8 Chisq= 202.41 on 1 degrees of freedom, p= 0 n= 5496 I am not quite sure how to use the output. I see that it gives the Scale parameter. How do I find the Shape paramater as a function of the covariate? Thank you, Steven --------------------------------------- ------------------------- Steven Shechter PhD Candidate in Industrial Engineering University of Pittsburgh pitt.edu/~sms13
Watalu, Y. (aka Wataru)
2005-Jun-09 02:19 UTC
[R] Weibull survival modeling with covariate
Hi, I'm also wondering which expression the survreg() uses for Weibull regression. Referring to help(survreg) and help(survreg.distributions), I guess survreg() fits the following model. survreg() uses a different parametrization, say F(x, Wshape, Wscale) = 1-exp(-Wscale*(x^Wshape))), and fits a parametric model with these formulas. Wshape = 1/"Scale" (calculated by survreg()) log(Wscale) = model with covariates Is it correct? Thanks a lot. Watalu> I was wondering if someone familiar > with survival analysis can help me with > the following. > I would like to fit a Weibull curve, > that may be dependent on a covariate, > my dataframe "labdata" that has the > fields "cov", "time", and "censor". Do > I do the following? > wieb<-survreg(Surv(labdata$time, > labadata$censor)~labdata$cov, > dist="weibull") > > This returns: >> weib > Call: > survreg(formula = Surv(labdata$time, > labdata$censor) ~ labdata$cov, > dist = "weibull") > > Coefficients: > (Intercept) labdata$cov > 8.091955112 0.001552897 > > Scale= 0.7532474 > > Loglik(model)= -12633.6 > Loglik(intercept only)= -12734.8 > Chisq= 202.41 on 1 degrees of > freedom, p= 0 > n= 5496 > > > I am not quite sure how to use the > output. I see that it gives the Scale > parameter. How do I find the Shape > paramater as a function of the > covariate? > > Thank you, > Steven > > --------------------------------------- > ------------------------- > Steven Shechter > PhD Candidate in Industrial Engineering > University of Pittsburgh > pitt.edu/~sms13 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html > >
On Wed, Jun 08, 2005 at 08:39:21PM -0400, sms13+ at pitt.edu wrote:> I was wondering if someone familiar > with survival analysis can help me with > the following. > I would like to fit a Weibull curve, > that may be dependent on a covariate, > my dataframe "labdata" that has the > fields "cov", "time", and "censor". Do > I do the following? > wieb<-survreg(Surv(labdata$time, > labadata$censor)~labdata$cov, > dist="weibull") > > This returns: > >weib > Call: > survreg(formula = Surv(labdata$time, > labdata$censor) ~ labdata$cov, > dist = "weibull") > > Coefficients: > (Intercept) labdata$cov > 8.091955112 0.001552897 > > Scale= 0.7532474 > > Loglik(model)= -12633.6 > Loglik(intercept only)= -12734.8 > Chisq= 202.41 on 1 degrees of > freedom, p= 0 > n= 5496 > > > I am not quite sure how to use the > output. I see that it gives the Scale > parameter. How do I find the Shape > paramater as a function of the > covariate?You don't. The analysis is performed on the logs of durations, so scale is transformed to location and shape to scale. For more intuitive output, use 'weibreg' in package 'eha'. It can also handle left truncated data. But only Weibull (and exponential) regression.> > Thank you, > Steven > > --------------------------------------- > ------------------------- > Steven Shechter > PhD Candidate in Industrial Engineering > University of Pittsburgh > pitt.edu/~sms13 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html >-- G??ran Brostr??m tel: +46 90 786 5223 Professor and Head Department of Statistics fax: +46 90 786 6614 Ume?? University stat.umu.se/~goran.brostrom SE-90187 Ume??, Sweden e-mail: gb at stat.umu.se