Skip to content

draw_binary_icc does not error if prob is of length N - but arbitrarily/randomly selects probs not of length k #189

Description

@graemeblair
tau <- 0.1

design <- 
  declare_model(
    clusters = add_level(N = 100, prob = runif(N, min = 0, max = 0.9), prob = if_else(prob < 0.2, 0, prob)),
    people = add_level(N = 10)
  ) + 
  declare_model(
    potential_outcomes(bin ~ draw_binary_icc(prob = prob * (1 + Z * tau), clusters = clusters, ICC = 0.1))
  ) 

design |> draw_data() |> group_by(zero = prob == 0) |> summarize(mean(bin_Z_0))

should have no 1's in the outcome in control when prob is 0 but it has lots

Need to handle prob of length N (or at minimum error if not)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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