stan-dev / rstanarm

rstanarm R package for Bayesian applied regression modeling
https://mc-stan.org/rstanarm
GNU General Public License v3.0
388 stars 133 forks source link

stan_clogit: allow outcome to be factor #519

Closed nlpaces closed 3 years ago

nlpaces commented 3 years ago

Summary:

Change acceptable class response variable

Description:

I had assumed that the class of response variable used in the standard clogistic regression function would be accepted in stan_clogit function. clogistic accepts factors. stan_clogit doesn’t. Once I had reformated to numeric, stan_clogit ran without difficulty.

Reproducible Steps:

Message from Jonah: Good catch! If you want to open an issue at the rstanarm GitHub repo we’ll definitely consider adding support for factors. I think it makes sense to allow them.

RStanARM Version:

2.21.1

R Version:

3.6.3

Operating System:

Ubuntu 18.04.4 LTS

jgabry commented 3 years ago

Thanks for opening the issue. We'll look into allowing the response variable to be a factor.

On Mon, May 10, 2021 at 6:16 PM nlpaces @.***> wrote:

Summary:

Change acceptable class response variable Description:

I had assumed that the class of response variable used in the standard clogistic regression function would be accepted in stan_clogit function. clogistic accepts factors. stan_clogit doesn’t. Once I had reformated to numeric, stan_clogit ran without difficulty. Reproducible Steps:

Message from Jonah: Good catch! If you want to open an issue at the rstanarm GitHub repo we’ll definitely consider adding support for factors. I think it makes sense to allow them. RStanARM Version:

2.21.1 R Version:

3.6.3 Operating System:

Ubuntu 18.04.4 LTS

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/519, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3PQQ4GGQD4KEMH4WMXWA3TNBZMDANCNFSM44TMBNSQ .

jgabry commented 3 years ago

This ended up being a really easy fix, so I already have a pull request open: https://github.com/stan-dev/rstanarm/pull/520. Thanks again for bringing this to our attention.