Skip to content

draw_normal_icc() doesn't allow for full range of ICC [0,1] #149

@clarabicalho

Description

@clarabicalho

Designers in the DesignLibrary relying on draw_normal_icc () should allow for to return values when ICC = 0 or 1 without requiring the designer to condition the distribution function on the icc value, oder? Also odd that it doesn't allow for ICC <= 0.001 or ICC >= 0.999. Could the default behavior be a warning instead?

clusters = rep(1:5, 10)
draw_normal_icc(clusters = clusters, ICC = 0.001)

Error in draw_normal_icc(clusters = clusters, ICC = 0.001) : An ICC of 0 with a finite within-cluster variance implies zero between-cluster variance. You can generate data with zero ICC using R's standard rnorm command to generate normal data independent of the cluster variable.

draw_normal_icc(clusters = clusters, ICC = 1)

Error in draw_normal_icc(clusters = clusters, ICC = 0.999) : An ICC of 1 with a finite within-cluster variance requires division by zero to infer between-cluster variance. Try a lower ICC or specify between- and within-cluster variance (sd_between and sd) to infer ICC.

Metadata

Metadata

Assignees

No one assigned

    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