vmonaco / frailtySurv

General Semiparametric Shared Frailty Model
12 stars 2 forks source link

Building confidence intervals for the frailty term #3

Open TiagoVentura opened 6 years ago

TiagoVentura commented 6 years ago

Hi!

I am using the frailtySurv package. It is working nicely here, thanks! I have a more theoretical question. I want to build confidence intervals for the frailty gamma term. How would you suggest me to proceed? I know from the p-value printed in the model the result I will find, but I want to build a graph with all the coefficients and the confidence intervals. Thanks again!

vmonaco commented 6 years ago

I'm glad you found the package useful.

Since the estimators are normally-distributed, it is possible to get a confidence interval for all parameters through the vcov function on the fit object:

COV.est <- vcov(fit)

The above computes the analytic covariance matrix. Then compute the confidence interval based on the normal variance.

To use a bootstrap procedure instead, try:

COV.boot <- vcov(fit, boot=TRUE, B=500)

Note the bootstrap procedure can be pretty computationally-intensive since it has to fit many models.

On Thu, May 3, 2018, 12:29 PM Tiago Ventura notifications@github.com wrote:

Hi!

I am using the frailtySurv package. It is working nicely here, thanks! I have a more theoretical question. I want to build confidence intervals for the frailty gamma term. How would you suggest me to proceed? I know from the p-value printed in the model the result I will find, but I want to build a graph with all the coefficients and the confidence intervals. Thanks again!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vmonaco/frailtySurv/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiM1_IljDnrxQ3jDgU6eVqvBMvN73Hxks5tuzBWgaJpZM4TxZsp .

TiagoVentura commented 6 years ago

Thanks for the reply!

Here is the thing, when you get the vcov for the model, the function only returns the fixed components of the model. Then, I don't have standard error for the variance of the random effects. This is the quantity I am not sure how to estimate

vmonaco commented 6 years ago

Just to clarify, for gamma and IG, theta is the variance of the shared frailty distribution. So vcov does give you the SE of the variance of the shared frailty.

Please correct me if I'm wrong: you'd like to compute the SE of the variance of the variance of the shared frailty (i.e., the SE of the result returned by vcov)? This might be possible using a weighted bootstrap on the analytic vcov itself. But I'm not certain that this is the right approach.

For details on the estimation method, please see: https://arxiv.org/pdf/math/0602253.pdf https://arxiv.org/pdf/math/0505387.pdf