Confidence Intervals for survreg (survival)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Confidence Intervals for survreg (survival)

ljantunes
Hello,
I am fitting a weibull regression model to a survival data set, using survreg from the survival package.I would like to obtain the confidence interval for the regression coefficients estimates, but I not seeing how.Can anyone help me?
Thanks,Luis

     
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Confidence Intervals for survreg (survival)

David Winsemius

On Aug 20, 2013, at 7:04 AM, Luis Antunes wrote:

> Hello,
> I am fitting a weibull regression model to a survival data set, using survreg from the survival package.I would like to obtain the confidence interval for the regression coefficients estimates, but I not seeing how.Can anyone help me?

?summary.survreg
?confint

Basically any regression object returned with list components 'coefficients' (actually with a coef()-method)  and 'var' can be passed to confint.
--
David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Confidence Intervals for survreg (survival)

ljantunes
Very simple, indeed.
Thank you very much for your help.
Luis


> Subject: Re: [R] Confidence Intervals for survreg (survival)
> From: [hidden email]
> Date: Tue, 20 Aug 2013 11:50:52 -0700
> CC: [hidden email]
> To: [hidden email]
>
>
> On Aug 20, 2013, at 7:04 AM, Luis Antunes wrote:
>
> > Hello,
> > I am fitting a weibull regression model to a survival data set, using survreg from the survival package.I would like to obtain the confidence interval for the regression coefficients estimates, but I not seeing how.Can anyone help me?
>
> ?summary.survreg
> ?confint
>
> Basically any regression object returned with list components 'coefficients' (actually with a coef()-method)  and 'var' can be passed to confint.
> --
> David Winsemius
> Alameda, CA, USA
>
     
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Confidence Intervals for survreg (survival)

annclaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Confidence Intervals for survreg (survival)

David Winsemius

On Mar 7, 2015, at 6:29 AM, annclaire wrote:

> Hello!
> I am trying to fit confidence intervals for my server object as well, but I
> can only get an interval estimation for the intercept coefficient and am
> getting NAs for my scale parameter.  Did you also have this issue?  
> Below is a rough outline of my code

>
>> newsurvobj <-Surv(studytimenew, censors)
>> newserv <- survfit(newsurvobj~1, type="kaplan-meier")
>> survreg(formula=newsurvobj~1, dist="weibull")
> Call:
> survreg(formula = newsurvobj ~ 1, dist = "weibull")
>
> Coefficients:
> (Intercept)
>   2.726151
>
> Scale= 0.4861742
>
> Loglik(model)= -160.8   Loglik(intercept only)= -160.8
> n= 100

I'm puzzled. First you tell `survreg` that you want a model with only an intercept term and then complain about it. Then you get a confidence interval for that parameter from `confint` and then you complain about getting NA's when you give `confint` an object that doesn't match the specifications for it in the help page.


>> ??confint
>> survival <- survreg(formula=newsurvobj~1, dist="weibull")
>> confint(survival, level=.95)
>               2.5 %   97.5 %
> (Intercept) 2.540459 2.911843
> confint(survival, "coefficients$scale",level=.95)
>                   2.5 % 97.5 %
> coefficients$scale    NA     NA



The second parameter to `confint` is supposed to be either a term name or a number. In your case the only available name (for a model term) would be `(Intercept)`. If you want the estimated scale, you would use `summary`. Read the ?summary.survreg page. The var (vcov object) includes the log(scale) parameter.


>
> Thank you so much for any help you can offer!
> -Ann
>

Uncommenting the Nabble link:
View this message in context: http://r.789695.n4.nabble.com/Confidence-Intervals-for-survreg-survival-tp4674137p4704283.html
Sent from the R help mailing list archive at Nabble.com.

I did go there thinking I might learn something about this question and found out that it was in followup to one of mine from two years ago. You should include context for your questions and understand that Nabble is neither the Rhelp mailing list nor does it function as its Archive. And it removes these important lines which I am now attempting to put before you (again)

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.

--
David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.