briandk / granovaGG

Bob Pruzek and Jim Helmreich's implementation of Elemental Graphics for Analysis of Variance
Other
15 stars 4 forks source link

boxes granovagg.1w should change color when F exceeds Fcritical #119

Closed briandk closed 12 years ago

briandk commented 13 years ago

Currently the boxes change color when F exceeds 1:

GetMSbetweenColor <- function(owp) {
  if (owp$stats$F.statistic > 1) {
    return(brewer.pal(n = 8, name = "Paired")[5])
  }

  else {
    return(brewer.pal(n = 8, name = "Paired")[2])
  }
}

GetMSwithinColor <- function(owp) {
  if (owp$stats$F.statistic > 1) {
    return(brewer.pal(n = 8, name = "Paired")[6])
  }

  else {
    return(brewer.pal(n = 8, name = "Paired")[1])
  }
}

If the thinking is that the box colors should "alert" the reader, it makes more sense to me to alert the reader to the presence of a significant F-statistic. So, the color change behavior should depend on

if (owp$stats$F.statistic > F.critical)

where we likely grab F.critical from summary model output info and a call to an F-distribution probability function.

In my own use of the granovagg.1w for exploratory data analysis, I've found that the visual property of the boxes does little to give me a sense of how close I am to the threshold of a significant effect. If anything, having a reliable color-change at the significance threshold (instead of the > 1 threshold) would help.

@rmpruzek and @wildoane, what are your thoughts?