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

pp_check with censored data #744

Closed
andymilne opened this issue Sep 3, 2019 · 3 comments
Closed

pp_check with censored data #744

andymilne opened this issue Sep 3, 2019 · 3 comments
Labels
Milestone

Comments

@andymilne
Copy link

Should it be possible to run pp_check with censored data? The following example results in the following error

fit3 <- brm(time | cens(censored) ~ age * sex + disease + (1|patient),
            data = kidney, family = lognormal())
pp_check(fit3)

Using 10 posterior samples for ppc type 'dens_overlay' by default.
Error in !cens : invalid argument type
In addition: Warning messages:
1: In drawGTree(x) : reached elapsed time limit
2: Censored responses are not shown in 'pp_check'. 
paul-buerkner added a commit that referenced this issue Sep 3, 2019
@paul-buerkner paul-buerkner added this to the brms 2.10.0++ milestone Sep 3, 2019
@paul-buerkner
Copy link
Owner

thanks! Should be fixed now

@lymanmark
Copy link

Seems to work with a numeric censoring variable, but a character variable ("right", "none", etc.) still has the same issue.

kidney <- kidney %>%
mutate(censored_alt = if_else(censored == 1, "right", "none"))

fit3 <- brm(time | cens(censored_alt) ~ age * sex + disease + (1|patient),
data = kidney, family = lognormal())
pp_check(fit3)

@paul-buerkner
Copy link
Owner

You are right. Should be fixed now.

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

No branches or pull requests

3 participants