Skip to content

effect_plot Error: Can't recycle input of size 2 to size 1 #100

@DonaKireta

Description

@DonaKireta

Hi,

I love the idea of effect_plot(), but I get the following error when trying to plot the results of a glm. I think the issue comes from the use of cbind in the formula.

Error: Can't recycle input of size 2 to size 1.
Backtrace:

  1. jtools::effect_plot(test_glm, pred = Age)
  2. vctrs:::stop_recycle_incompatible_size(...)
  3. vctrs:::stop_vctrs(...)

An example that produces the error:

pacman::p_load(jtools, titanic)
 
df <- titanic::titanic_train
 
test_glm <- glm(cbind(Survived, 1 - Survived) ~ Sex + Age, data = df, family = binomial)
summary(test_glm)

effect_plot(test_glm, pred = Age)

Thank you in advance for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions