Skip to content

New bug: get_weights.svyglm() is broken on Github #1144

@vincentarelbundock

Description

@vincentarelbundock

I think that the latest version of insight breaks marginaleffects tests because it no longer retrieves weights from survey objects.

This appears to be a bug introduced recently. Versions of insight as recent as 6 commits ago behave as expected.

library(insight)
library(survey)
packageVersion("survey")
[1] '4.4.8'
packageVersion("insight")
[1] '1.4.2.8'
data("fpc", package = "survey")
svyd <- survey::svydesign(
    weights = ~weight,
    ids = ~psuid,
    strata = ~stratid,
    fpc = ~Nh,
    variables = ~ x + nh,
    data = fpc,
    nest = TRUE
)
mod <- survey::svyglm(x ~ nh, design = svyd)
find_weights(mod)
[1] "weight"
get_weights(mod)
NULL

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions