Skip to content

Incorrect output for expand() when dealing with asymmetric trees #100

@abhsarma

Description

@abhsarma

When dealing with asymmetric trees (see example below), the output of expand(M) is not accurate. For instance consider the following multiverse:

# a random simulated dataset
N = 100

df = tibble(
  score = rlnorm(N),
  pretest1 = round(runif(N) * 100),
  pretest2 = round(runif(N) * 100),
  reaction_time = rnorm(N, 5, 1),
  HR = round(rnorm(N, 90, 10)),
  fatigue = sample(seq(1:7), size = N, replace = TRUE)
)
fit = branch(model, 
         "normal" ~ glm(log(score) ~ pretest1 + pretest2 + 
                        branch(interaction, 
                               "yes" ~ reaction_time:HR,
                               "no" ~ reaction_time:HR) + 
                        fatigue, data = df, family = "gaussian"),
         "binomial" ~ glm(score ~ pretest1 + pretest2 + 
                          fatigue, data = df, family = "binomial")
      )

This multiverse consists of three distinct paths, but the table produced by expand() contains four. This is probably due to naively taking all possible combinations of options for each parameter

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions