Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Censored Data in Bambi #541

Closed
don-jil opened this issue Jun 26, 2022 · 7 comments
Closed

Censored Data in Bambi #541

don-jil opened this issue Jun 26, 2022 · 7 comments

Comments

@don-jil
Copy link

don-jil commented Jun 26, 2022

First, I'm delighted to find babmi and formulae, and very much appreciate all the work you are doing in this space. I'm working with some censored data. I have used brms in R to build models in STAN, but I'd like to transition to python where the data preparation and visualization work occurs. As a feature request, I would very much like to have the ability to use bambi (and formulae) to build the pymc model for censored data and survival analysis. I am currently working on this in pymc without bambi (and formulae), but I love the Wilkinson formula approach. If this should be posted on the formulae repo instead, I'd be happy to do that.

@ipa
Copy link

ipa commented Jun 27, 2022

I was just about to open a similar request... I've built a generic survival model using the pymc-learn API and was thinking about contributing it to bambi. The model uses the Weibull distribution (I don't have a Cox model). However, it has only been tested with 'right' censored data.

My proposed syntax for the formula would be: time | censor ~ x1 + x2 + x3.
censor would contain information about censoring as ('left', 'none', 'right', and 'interval') or (-1, 0, 1, and 2) analogous to brms.

Let's discuss. Would be happy to contribute on this.

@ipa
Copy link

ipa commented Jul 1, 2022

This requires changes in the formulae package. Instead of time | censor it would be cleaner to implement this as a transformation Surv(time, event) similar to R.

I opened another issue bambinos/formulae#79

Work in progress on my fork

@don-jil
Copy link
Author

don-jil commented Sep 9, 2022

Just a ping, here. I love that this is moving along & that there is a really pull-request @ipa! Is there anything that is missing @tomicapretto? Anything I can do to help?

@tomicapretto
Copy link
Collaborator

@ipa @don-jil I haven't had much time to work in Bambi lately. But I'm slowly starting to gain momentum again.

The thing with the PR opened is that it will just work for that particular case. I think we need something more general and that requires working both in formulae and bambi internals if I recall correctly.

I think I'll have something in my hands in the next 15 days. Would you be interested in helping to test/document stuff?

@don-jil
Copy link
Author

don-jil commented Sep 20, 2022

Sorry for the delayed response, but yes happy to help test and or document. :-) Will respond in the pull request to that end.

@tomicapretto
Copy link
Collaborator

I'm working on a proposal for models for censored data in Bambi. The problem is that I'm not very familiar with interval censoring (we can decide not to support this in a first shot), but I would still like to understand how it works.

@ipa @don-jil do you know of any references to interval censoring? Thanks!

@tomicapretto
Copy link
Collaborator

tomicapretto commented Aug 8, 2023

Closed since #577 and #697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants