Skip to content

Add support for WRS2::yuenbt() and WRS2::pb2gen() #1083

@profandyfield

Description

@profandyfield

In .extract_wrs2_yuen in

https://github.com/easystats/parameters/blob/main/R/methods_wrs2.R

If you tweak

if (grepl("^(yuen\\(|WRS2::yuen\\()", fcall) ||
    grepl("function (formula, data, tr = 0.2, ...)", fcall, fixed = TRUE)) { ....

To include grepl("^(yuenbt\\(|WRS2::yuen\\()", fcall) (note the bt), and have some kind of ifelse() to remove the effect size stuff from the table, then parameters() would work with models from the yuenbt() function from WRS2.

Similarly it would be good to have a method for WRS2::pb2gen(), which has fewer values than yuen models but they have the same names ($test, $conf.int, $p.value), so seems straightforward to tweak the code based on whether the call contains yuen, yuenbt or pb2gen

cloak_tib <- tibble::tibble(
    id = c("Kiara", "Anupama", "Collin", "Ian", "Vanessa", "Darrell", "Tyler", "Steven", "Katheryn", "Kirkpatrick", "Melissa", "Kinaana", "Shajee'a", "Sage", "Jorge", "Conan","Tamara","Man", "Joseph", "Israa", "Kathryn", "Luis", "Devante", "Jerry"),
    cloak = gl(2, 12, labels = c("No cloak", "Cloak")),
    mischief = c(3, 1, 5, 4, 6, 4, 6, 2, 0, 5, 4, 5, 4, 3, 6, 6, 8, 5, 5, 4, 2, 5, 7, 5)
  )

rob_pb <- WRS2::pb2gen(mischief ~ cloak, data = cloak_tib) 
rob_pb$test
rob_pb$conf.int
rob_pb$p.value
rob_pb$call

Metadata

Metadata

Assignees

Labels

Enhancement 💥Implemented features can be improved or revised

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions