stan-dev / stan-dev/rstanarm

Very small bug in vignette code

Open
#246 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Summary:

In the "How to use the rstanarm package" vignette, there is a line that calls shinystan. This code throws an error.

Description:

The error is as follows:

Error in validate_y(y) : NAs not allowed in 'y'.

The reason this occurs is because there is a row in the dataset that has both agree and disagree equal to 0. The model fits fine, but the shinystan code throws the error. If you remove this line from the dataset before fitting the model, there is no error. You likely want to fix this within shinystan, but since it's an rstanarm vignette I was running, I'm posting it here.

Reproducible Steps:
data("womensrole", package = "HSAUR3")
womensrole$total <- womensrole$agree + womensrole$disagree
library(rstanarm)
CORES <- 4
SEED <- 12345
CHAINS <- 4
womensrole_bglm_1 <- stan_glm(cbind(agree, disagree) ~ education + gender,
                              data = womensrole,
                              family = binomial(link = "logit"), 
                              prior = student_t(df = 7), 
                              prior_intercept = student_t(df = 7),
                              chains = CHAINS, cores = CORES, seed = SEED)

library(shinystan)
launch_shinystan(womensrole_bglm_1)
RStanARM Version:

2.15.3 (shinystan version 2.3.0)

R Version:

3.4.0

Operating System:

Windows 10

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

Reproduce the failure using the provided womensrole data, stan_glm call, and launch_shinystan(womensrole_bglm_1) entry point. Inspect the “How to use the rstanarm package” vignette and determine whether the failing behavior belongs to the vignette or shinystan; done means the reported vignette workflow no longer errors or the issue is clearly redirected upstream.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
documentation
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.