Issues with compare()

Open
#452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

The error comes from $ being applied to the cstanfit attribute of a fitted model inside compare(), so start with that attribute: fit two small binomial models, then check class(attr(fit, "cstanfit")) and what compare() expects there. The report says it fails with cmdstanr 0.8.1.9 and that the work-around in #443 breaks it, so compare those two code paths. Done means compare() runs on the binomial models without the S4 error and the outputs still save.

Written by the indexing model from the issue text.

Description

bug

I am trying to compare multiple binomial models that have various combinations of variables. When I try to compare(modelnames...), I receive the following error message:
Error in attr(object, "cstanfit")$draws : $ operator not defined for this S4 class

Any insight on what may be causing this? This is a new problem and wasn't having this issue about a month ago.
I have tried using the current version of rethinking, compare will work but it will not save my outputs. I have used @timjzee 's version noted in #443 which will save outputs successfully, but I will receive that error when comparing. I have tried mixing and matching rethinking versions and that does not work.
Cmdnstanr version 0.8.1.9

Thanks!

Dominant language
R
Stars
2.4k
Forks
632
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from rmcelreath/rethinking

All issues in rmcelreath/rethinking

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.