{"issue":{"pull_request":{"diff_url":"https://github.com/briandk/granovaGG/pull/135.diff","html_url":"https://github.com/briandk/granovaGG/pull/135","patch_url":"https://github.com/briandk/granovaGG/pull/135.patch"},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/cee393979ed94cedbcfdd7ac693b1b1d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cee393979ed94cedbcfdd7ac693b1b1d","url":"https://api.github.com/users/briandk","login":"briandk","id":330036},"milestone":null,"updated_at":"2011-11-08T18:17:01Z","labels":[],"assignee":null,"comments":1,"closed_at":null,"url":"https://api.github.com/repos/briandk/granovaGG/issues/135","body":"The default value for jitter (`jj`) in `granova.1w` was `1`:\r\n\r\n```r\r\ngranova.1w(data, group = NULL, dg = 2, h.rng = 1.25, v.rng = 0.2, \r\n   box = FALSE, jj = 1, kx = 1, px = 1, size.line = -2.5, \r\n   top.dot = 0.15, trmean = FALSE, resid = FALSE, dosqrs = TRUE, \r\n   ident = FALSE, pt.lab = NULL, xlab = NULL, ylab = NULL, \r\n   main = NULL, ...)\r\n```\r\n\r\nFor `granovagg.1w`, [we introduced overplotting logic][1] that would recalibrate jitter if groups were too close together. The idea was to protect the user: if groups were too close together, the jittering amount would be very conservative so adjacently plotted groups could still be individually resolved. But, introducing that logic involved a key departure from the classic `granova.1w` API. With the new overplotting logic:\r\n\r\n- The default value of `jj` was set to `NULL`\r\n- if `jj == NULL`, the jitter amount defaulted to one percent of the horizontal resolution of the data, UNLESS `jj == NULL` _and_ at least one pair of means was in danger of overplotting. If there was overplotting danger when `jj` was set to `NULL`, the jitter amount would default to the smallest distance between adjacent contrasts.\r\n\r\nIf we want change the default value of jj to 1, I fear we'll have to go one of two routes:\r\n\r\n1. Remove the jittering overplotting logic entirely.\r\n2. Keep the overplotting logic, but conditionally ignore any user-supplied `jj` values if the group means are in danger of overplotting.\r\n3. Keep the jittering overplotting logic, but add a new parameter to `granovagg.1w` called something like `safe.jittering` that would turn the overplotting logic on or off, thus allowing the user to bypass overplotting protection.\r\n\r\nOption 1 is simple and possible. Combined with our current logic for marking likely overplotted groups in red, it lets the user simply tweak and shrink jittering until they can safely resolve groups. But it's risky if users don't recognize when their data is overplotted.\r\n\r\nOption 2 strikes me as undesirable: it gives users the illusion of having control over jittering when really we can be like overprotective parents and override their supplied value if we think it's too dangerous.\r\n\r\nOption 3 is kludgy, inelegant, and adds an additional burden to the user for remembering parameters.\r\n\r\nI need both @rmpruzek and @wildoane to weigh in on this issue before I can go forward with any changes.\r\n\r\n\r\n\r\n\r\n\r\n\r\n[1]: https://github.com/briandk/granovaGG/commit/ad39a745c07a94be8db046a978994cddb657dbef\r\n","html_url":"https://github.com/briandk/granovaGG/issues/135","number":135,"title":"Granovagg1w jitter interferes with overplotting logic","id":1895353,"created_at":"2011-10-12T23:17:44Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/cc9de3013ff721f1275407053722da2b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cc9de3013ff721f1275407053722da2b","url":"https://api.github.com/users/rmpruzek","login":"rmpruzek","id":819647},"updated_at":"2011-11-08T18:17:01Z","url":"https://api.github.com/repos/briandk/granovaGG/issues/comments/2671229","body":"Overplotting is clearly something we want to avoid, but there are several ways to deal with this, and after a good deal of thought, I want to recommend the following (and this does remove the overplotting logic as per Brian's narrative above):\r\nSuppose a subset of k means, and hence the effects for the corresponding groups [m<j> - grandmean] are 'sufficiently close to one another that the case-data points run into one another. (Okay to be 'liberal' about choosing k; better to overestimate than underestimate.) Now proceed to alter the .1w graphic (so it will lack complete fidelity wrt the initial means), as follows. Compute the median of these k means. Now compute 'pseudo effects' by subtracting the median* (md) from each of the k means; these will be of the form m<j> - md. Multiply all pseudo effects by a constant (W, say, where W exceeds unity (or one) by a positive constant w*, where w* is a function of the range R of all means. (e.g., w* = R/25 seems reasonable. This leads to W = 1 + R/25. Finally, add the midrange mr to each of these revised pseudo effects; these will be of the form W*(m<j> - md) + md. That's it. These k values will serve as replacements for the original group means. They will necessarily be separated from one another in relation to the original k means simply because W exceeds unity. The average of all 'means' will not be changed (more than trivially) from the original grand mean, and the printed table should probably just ignore these adjusted means (except in trials?) so it will only be the graphic that has been altered. Again, perfect fidelity w/ the original data will of course have been lost in the graphic, but the gain will more than compensate for the rather minor changes in the data-to-be-plotted. ","id":2671229,"created_at":"2011-11-08T18:17:01Z"}}