Quantile plot
A quantile plot is a figure in which \(X_{(i)}\) is plotted versus \(f_{i}\). Let us focus on the second Bass voice group in the singer dataset. The panel below presents the singers’ height and the corresponding \(f\) value. The minimum is equal to 66 with \(f-value=0.0384= \frac{1}{n}\) and the maximum is equal to 75 with \(f-value=1 =\frac{n}{n}\).
x<-sort(singer$height[singer$voice.part=="Bass 2"])
n<-length(x)
f.value<-c(1:n)/n
cbind(x,f.value)
## x f.value
## [1,] 66 0.03846154
## [2,] 67 0.07692308
## [3,] 67 0.11538462
## [4,] 68 0.15384615
## [5,] 68 0.19230769
## [6,] 69 0.23076923
## [7,] 70 0.26923077
## [8,] 70 0.30769231
## [9,] 70 0.34615385
## [10,] 70 0.38461538
## [11,] 71 0.42307692
## [12,] 72 0.46153846
## [13,] 72 0.50000000
## [14,] 72 0.53846154
## [15,] 72 0.57692308
## [16,] 72 0.61538462
## [17,] 72 0.65384615
## [18,] 72 0.69230769
## [19,] 74 0.73076923
## [20,] 74 0.76923077
## [21,] 74 0.80769231
## [22,] 74 0.84615385
## [23,] 75 0.88461538
## [24,] 75 0.92307692
## [25,] 75 0.96153846
## [26,] 75 1.00000000
Figure 54 presents the quantile plot for the Bass2 group. Note that the median (72) is the value that cross the Horizontal line of \(f-value=0.5\).
plot(x,f.value,type="s")
abline(0.5,0,col=2)
To produce the quantile plot for the second Bass group, shown in Figure 55, we can use the function qqmath() of the R package lattice with the argument distribution = qunif in the following way
qqmath(~ height[voice.part=="Bass 2"] | voice.part[voice.part=="Bass 2"] , aspect = "xy",
data = singer,layout=c(1,1),distribution = qunif,
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})
The argument distribution = qunif implies that quantile for a uniform distribution will be calculated, i.e, \(f_{i}=i/n\). Figure 56 shows the quantile plot for all voice groups.
qqmath(~ height | voice.part, aspect = 0.25, data = singer,layout=c(2,4),
distribution = qunif,
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})