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

Wrong p-value if subset is specified in the model #71

Closed
jseoane opened this issue Oct 28, 2016 · 1 comment
Closed

Wrong p-value if subset is specified in the model #71

jseoane opened this issue Oct 28, 2016 · 1 comment

Comments

@jseoane
Copy link

jseoane commented Oct 28, 2016

The surv.diff p-value is not the same that the one reported in the plot when a subset is selected in the fitted survival model (i.e. surv.fit(Surv(time,event)~feature,data=data1,subset=feature2==TRUE) )

This is caused because you are getting the information for calculate p-value from the original data object in the function .get_pvalue, without checking if a subset was selected.

kassambara added a commit that referenced this issue Oct 29, 2016
kassambara added a commit that referenced this issue Oct 29, 2016
@kassambara
Copy link
Owner

kassambara commented Oct 29, 2016

Hi @jseoane ,

Thank you for pointing this out! The issue is now fixed.

Please install the latest version on Github and let me know if it's ok for you, so that we can close the issue.

  • Install
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/survminer", build_vignettes = FALSE)
  • Example
library("survival")
library("survminer")
fit <- survfit(Surv(time, status)~sex, subset = ph.ecog==1, data = lung)
ggsurvplot(fit, risk.table = TRUE, pval = TRUE)

Best,
/A

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

No branches or pull requests

2 participants