ROS-Examples icon indicating copy to clipboard operation
ROS-Examples copied to clipboard

Error when running Storable Vignette (stan_polr)

Open bsbodden opened this issue 1 year ago • 1 comments

The call to stan_polr in:

fit_1 <- stan_polr(factor_vote ~ value, data = data_401,
                   prior = R2(0.3, "mean"), refresh = 0)

Produces the error:

Error in cor(obs, pred, use = ifelse(na.rm, "complete.obs", "everything")) :
'x' must be numeric
  5. stop("'x' must be numeric")
  4. cor(obs, pred, use = ifelse(na.rm, "complete.obs", "everything"))
  3. R2(0.3, "mean")
  2. stan_polr.fit(x = x, y = y, wt = wt, offset = offset, method = method,
            prior = prior, prior_counts = prior_counts, shape = shape,
            rate = rate, prior_PD = prior_PD, algorithm = algorithm,
            adapt_delta = adapt_delta, do_residuals = do_residuals, ...)
1. stan_polr(factor_vote ~ value, data = data_401, prior = R2(0.3, "mean"), refresh = 0)

Versions:

R version 4.2.3 (2023-03-15)
> packageVersion("rstanarm")   
[1] ‘2.21.4’

bsbodden avatar Apr 30 '23 15:04 bsbodden

It's a bug, something to do with R, it's getting fixed.

andrewgelman avatar Oct 30 '23 21:10 andrewgelman