Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upqqmath.permustats and reference distribution #172
Comments
|
Even with your notes in the examples, the plots for set.seed(0)
xx <- rt(10000, df = 10)
qqmath(~ xx, pch = "+", distribution = qnorm,
grid = TRUE, abline = c(0, 1),
xlab.top = c("raw", "ppoints(100)", "tails.n = 50"),
panel = function(..., f.value) {
switch(panel.number(),
panel.qqmath(..., f.value = NULL),
panel.qqmath(..., f.value = ppoints(100)),
panel.qqmath(..., f.value = ppoints(100), tails.n = 50))
}, layout = c(3, 1))[c(1,1,1)]So, we could easily modify
I'll have a go at implementing this for |
|
I think a custom panel function that accepts a vector * == famous last words |
|
I think |
qqmathfunction accepts argumentdistributionto find the expected quantiles in the Q-Q plot. The default is to plot permutations against Gaussian distribution (qnorm). However, this is a bad choice in several cases. For instance,example(permutest.betadisper)gives:One panel shows F-statistic and another shows t-statistic which have different scales and shapes. It is possible to have separate scales for panels (
scales = list(relation = "free")), but the shapes are still different. It is possible to give thedistributionused for the theoretical quantile (horizontal axis), but it is more tedious to do this separately for each panel (see?panel.qqmath), and getting the scaling right is even more cumbersome (I think this would need writing aprepanelfunction). However, actually we would like to get something like this:Here
Fis plotted against F-distribution andtagainst t-distribution, both with correct degrees of freedom and using separate scaling. This is much better than the current plot for diagnostic purposes.I didn't find a nice way to do this with
qqmath, and the quick graph above is based on the ideaxyplot(permuted ~ expected | statistic, scales = list(relation = "free"), abline = c(0,1)).To do this in general, we should
permustatsmethod when this makes sense. The default would be to have nothing and relying onqqmathusing Gaussian distribution. I think the new item should be given forbetadisper,adonisandanova.ccamethods.qqmath.permustatsto use the reference distribution for each panel when such is given. This is the harder part to get right.