Skip to content

Add variance formula for Kaplan Meier estimator#678

Open
syadlowsky wants to merge 2 commits intoCamDavidsonPilon:masterfrom
syadlowsky:master
Open

Add variance formula for Kaplan Meier estimator#678
syadlowsky wants to merge 2 commits intoCamDavidsonPilon:masterfrom
syadlowsky:master

Conversation

@syadlowsky
Copy link

No description provided.

@CamDavidsonPilon
Copy link
Owner

👋 hello @syadlowsky!

Thanks for the contribution - can you expand on why you would like to see this added?

@syadlowsky
Copy link
Author

I'm working on a project where, to do inference, we need to be able to estimate the variance of the Kaplan-Meier estimator. It looks like right now, you only have the confidence intervals, but exposing the variance estimator itself might be useful for others' downstream applications, as well.

@syadlowsky
Copy link
Author

Just wanted to bring this up again.

@CamDavidsonPilon
Copy link
Owner

Sorry about the delay!

So overall I like this PR, but I want to keep the variance's computed here the same as the variances computed in the CIs. That is, I feel this should be using the exponential form of greenwood's variance. (eq 1.3 in the notes in the docstring). What do you think?

@syadlowsky
Copy link
Author

Somehow, I didn't see the reply. Sorry about that. The issue with the exponential form of the variance is that it gives a variance for log(S(t)), whereas I need (and one might expect a variance function to give) the variance for S(t).

One alternative is to add both, adding the exponential form as variance_log_survival_. At least this gives something clear for people to think about when choosing which they want, and would possibly allow some code reuse with the confidence interval estimates. Plus it would give something to point to if someone asks why variance_ doesn't line up with confidence intervals.

Does this seem like reasonable recourse? If so, I can fix this and try to deal with the merge conflict that has come up in the meantime.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants