Toothpics()
Example 1: Basic ideas and comparisons
Example 2: Log-scaling works!
Example 3: Other than log-scaling
Example 5: A 2 x 2 factorial design
Example 1: Basic ideas and comparisons
Example 2: Log-scaling works!
Example 3: Other than log-scaling
Example 5: A 2 x 2 factorial design
Example 4: How large can N be in a group?
Let n.max the maximum group sample size increase. If n.max ≤ 100, no adjustment is made to the toothpick thickness. If n.max ≥ 400, the thickness is equivalent to specifying TPThickness = 0.30 (70% less). Between 100 and 400, the thickness is (1 - (0.70/300)*(n.max-100))*TPThickness
How well does this make toothpicks visually distinct?
Graphic 4 shows three logNormal variates plotted without log-scaling. Their medians (Md) are 10, 15, and 20, and each has a 95% relative spread (RS95) of 4, meaning that the ratio of their 0.975 and 0.025 quantiles is 4, i.e., Q(0.975)/Q(0.025) = 4. (I've found that this is the easiest way to parameterize Y ~ logNormal. Given Md and RS95, log(Y) ~ N(mean=log(Md), SD=log(RS95)/(2*1.96)).
Complete R code
n <- 400
Md <- c(10, 15, 20)
RS95 <- 4
Md.group <- rep(Md,each=n)
set.seed(126734)
y = NULL
for (i in 1:length(Md)) {
y <- c(y, exp(rnorm(n, log(Md[i]), log(RS95)/(2*1.96))))
}
PlotDirector(PlotSize=list(w=6, h=6.5), CloseOld=TRUE)
Toothpics(
Title=paste("n =", n, "Per Group"),
Y=y,
YLabel="Y (not log-scaled)",
Group=Md.group,
GroupLevels=Md,
GroupLabel="Median of LogNormal with 95% Relative Spread 4",
GroupLabelMoveUp = -0.25,
MQDigits=2,
Quantiles=0.50,
PlotQCIs=0.95,
RelFontSize=c(1,0.8,1,0.8,1,1)
)
Graphic 4
What you see above is a .jpg screenshot from a 15-inch MacBook Retina screen. It looks fine on that screen, giving a clear sense of density, but it may degrade on other screens, especially an LCD projection.
When the sample sizes are just too large to use Toothpics(), I recommend using a violin plot. I hope to someday release an Rfunc for that, too, but it's way down my to-do list, especially because I believe that Toothpics() can handle most problems that people have. N = 400 in a group is not small. I was pleasantly surprised.