stan-dev / stan-dev/rstanarm

ranef() missing for stan_surv model

Open
#440 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

survival
Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Summary:

Hello, I was hoping to see if ranef() is available in any branch (or will be soon) for multilevel stan_surv objects? The documentation states that it is there but calling it errors out (I'm on rstanarm 2.19.1):

> ranef(multilevel_model)

Error: This method is for stan_glmer and stan_lmer models only.
Traceback:

1. ranef(multilevel_model)
2. ranef.stanreg(multilevel_model)
3. .glmer_check(object)
4. stop("This method is for stan_glmer and stan_lmer models only.", 
 .     call. = FALSE)

In case it's helpful, here's the model formula:

Surv(time_to_status_days_float, Expired) ~ treatment + Sex + age_ordinal + DNR + (1 | LocationName)
RStanARM Version:

2.19.1

R Version:

3.6.3

Operating System:

OS X 10.14.2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing ranef.stanreg through .glmer_check, using the reported stan_surv model and error as the reproduction case. Compare the existing stan_glmer and stan_lmer handling with the stan_surv path. Done means the documented ranef() call no longer raises this model-type error for a multilevel stan_surv object.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.