Analysis of Mean Absolute Deviation for Randomized Block Design under Laplace Distribution
Elsayed A. H. Elamir
Email address:
To cite this article:
Elsayed A. H. Elamir. Analysis of Mean Absolute Deviation for Randomized Block Design under Laplace Distribution. American Journal of Theoretical and Applied Statistics. Vol. 4, No. 3, 2015, pp. 138149. doi: 10.11648/j.ajtas.20150403.19
Abstract: Analysis of mean absolute deviation (ANOMAD) for randomized block design is derived where the total sum of absolute deviation (TSA) is partition into exact block sum of absolute deviation (BLSA), exact treatment sum of absolute deviation (TRSA) and within sum of absolute deviation (WSA). The exact partitions are derived by getting rid of the absolute function from MAD by using the idea of reexpressing the mean absolute deviation as a weighted average of data with sum of weights zero. ANOMAD has advantages: offers meaningful measure of dispersion, does not square data, and can be extended to other location measures such as median. Two ANOMAD graphs are proposed. However, the variancegamma distribution is used to fit the sampling distributions for the mean of BLSA and the mean of TRSA. Consequently, two tests of equal means and medians are proposed under the assumption of Laplace distribution.
Keywords: ANOVA, Effect Sizes, Laplace Distribution, MAD, VarianceGamma Distribution
1. Introduction
There has been an increasing interest in properties and applications of a Laplace distribution (see, for example, [2], [12], [13], [10] and [23]. A Laplace distribution possesses a number of favourable characteristics which make it attractive for many applications; see, [12]. In particular, a simple closed form, stability and robustness to model misspecification. Laplace distribution is found to be especially appealing in modelling heavy tailed processes in finance, engineering, astronomy and environmental sciences ([9], [16], [15] and [21]. It may also offer certain pedagogical advantages; see, [1] and [7]. For extensive discussion and comparisons; see, [19] and [6].
A random variable has a Laplace distribution with location parameter and scale if its probability density function is
The Laplace distribution has
The probability density function of the Laplace distribution is also reminiscent of the normal distribution; whereas the normal distribution is expressed in terms of the squared difference from the mean while the Laplace density is expressed in terms of the absolute difference from the mean or median.
A randomized complete block design is a restricted randomization design in which the experimental units are first sorted into homogeneous rows, called blocks, and the groups (treatments) are then assigned at random within the blocks; see, [17]. The model for a randomized complete block design containing the comparison of no interaction effects, when both the block and treatment effects are fixed and there are blocks (BL) and groups (TR), is as
is a constant, are constants for the block (row) effects, are constants for the group (column) effects and are independent .
Analysis of mean absolute deviation (ANOMAD) for a randomized complete block design is derived where the total sum of absolute deviation (TSA) is partition into exact block sum of absolute deviation (BLSA), exact treatment sum of absolute deviation (TRSA) and within sum of absolute deviation (WSA). The exact partitions are derived by getting rid of the absolute function by using the idea of reexpressing the mean absolute deviation as a weighted average of data with sum of weights zero. Since the MAD is a natural parameter of the Laplace distribution, the sampling distributions of scaled BLSA and TRSA are studied under the assumption of Laplace distribution using the variancegamma distribution (generalized Laplace distribution). Consequently, an analysis of mean absolute deviation is proposed to test for equal population means and medians and two measures of effect sizes are extended to ANOMAD test.
Representation of MAD as a weighted average is presented in Section 2. The partitions of TSA into exact BLSA, exact WSA and ANOMAD tables are derived in Section 3. The sampling distributions for block and treatment are introduced in Section 4. Two graphs are suggested in Section 5. ANOMAD tests for equal means and median with effect sizes are studied in Section 6. Section 7 is devoted to conclusion.
2. Representation of MAD as a Weighted Average
Let be a random sample from a continuous distribution with, density function , quantile function , , cumulative distribution function , and .
Elamir (2012) and [11] defined MAD about mean and median as
and
where
From [5] this can be estimated as
and
where
3. Exact MAD Partitions Mean and Median
Assume there are different groups (treatments) with individuals in each group , with block , and . Let is the total deviation (), is the deviation of group mean () around total mean, is the deviation of block mean () around total mean and is the error or within.
The sample MAD about mean is
This is a weighted average form where
Note that,
Therefore, the total sum of absolute value is considered to be
This is the most important equation to obtain the exact analysis of mean absolute deviations about mean and median.
3.1. Theorem 1
In a randomized complete block design the total sum of absolute deviations about mean is partitions as
where
and
Proof:
Where, the total sum of absolute deviations is
By adding and subtracting , and and taking the summation over both and then
Therefore,
3.2. Theorem 2
In a randomized complete block design the total sum of absolute deviations about median is partitions as
where
and
Proof: same as mean.
3.3. Comparison with ANOVA
The analysis of variance (ANOVA) for a randomized complete block design is
See; for example, [17].
The analysis of mean absolute deviation (ANOMAD) for a randomized complete block design is
Note that:
1. ANOMAD replaces the square in ANOVA by weight and that ensures stability in statistical inferences.
2. ANOMAD can be extended to other measures of location easily, for example, median.
3.4. Illustrative Example
To have an idea on how the method work. Table 1 shows TSA partition for a hypothetical data. Note that, , , and and the total that gives exact partitions
3.5. Divisors and ANOMAD Tables
ANOMAD is introduced and used to test for equal population means and medians under the following assumptions.
1. The observations are random and independent samples from the populations.
2. The distributions of the populations from which the samples are selected are Laplace distribution.
3. The ’s of the distributions in the populations are equal.
A simulation study is conducted to compute the suitable divisors for scaled BLSA, TRSA and WSA using the following steps:
1. For selected design simulate data from Laplace distribution using a very large number .
2. Compute , , and for each and .
3. Compute the average for each one.
From the simulation results in Table 2, the proposed ANOMAD table about mean is summarized in Table 3. A simulation study is conducted to compute the suitable divisors for scaled BLSA, TRSA and WSA using the following steps:
1. For selected design simulate data from Laplace distribution using a very large number .
2. Compute , , and for each and .
3. Compute the average for each one.
From the simulation results in Table 2, the proposed ANOMAD table about mean is summarized in Table 3. Also, from the simulation results in Table 2, the proposed ANOMAD table about median is summarized in Table 4.
Table 1. partition into , and for a hypothetical data.








Group 1  
8  0.5  1  1.167  9.336  2.917  2.917  5.25 
11  3.5  1  1.167  12.837  0.583  2.917  1.75 
18  10.5  1  1.167  21.006  0.583  2.917  8.75 
3  4.5  0  0.833  2.499  2.083  2.082  3.75 
Group 2  
20  12.5  1  1.167  23.34  2.917  0  11.67 
1  6.5  0  0.833  0.833  0.417  0  5.00 
4  3.5  0  0.833  3.332  0.417  0  3.33 
5  2.5  0  0.833  4.165  2.083  0  0.00 
Group 3  
2  5.5  0  0.833  1.666  2.083  2.082  4.58 
9  1.5  1  1.167  10.503  0.583  2.917  5.25 
2  5.5  0  0.833  1.666  0.417  2.082  2.91 
7  0.5  0  0.833  5.831  2.083  2.082  3.75 
Total  57 
 9  10  38 
Table 2. simulated averages for , and with different values of and from Laplace distribution and the number of replications is 10000.
 3  5  7  10  3  5  7  10  3  5  7  10  
using mean  
5  4.166  4.11  4.08  4.07  2.11  4.15  6.18  9.24  8.45  16.45  24.50  36.54  
10  9.230  9.19  9.07  9.03  2.06  4.09  6.11  9.11  18.48  36.60  54.68  81.75  
15  14.11  14.15  14.08  14.02  1.98  4.08  6.05  9.06  28.57  56.80  84.76  126.7  
20  19.30  19.20  19.11  19.12  2.06  4.05  6.02  9.07  38.52  76.74  114.8  171.5  
30  29.29  29.17  29.12  29.09  2.05  4.01  6.02  8.99  58.72  116.8  174.8  261.8  
50  49.30  49.12  49.13  49.07  2.02  3.99  6.02  8.99  98.70  197.0  294.8  441.6  
100  99.35  99.12  99.15  99.11  1.99  4.01  5.95  9.02  198.7  397.2  594.5  892.1  
Using median  
5  4.17  4.15  4.13  4.13  2.15  4.13  6.19  9.20  8.15  16.20  24.23  36.12  
10  9.12  9.21  9.15  9.11  2.10  4.10  6.12  9.08  18.16  36.11  54.10  81.27  
15  14.20  14.16  14.13  14.10  2.05  4.09  6.07  9.10  28.12  56.17  84.17  126.6  
20  19.81  19.15  19.10  19.05  2.07  4.07  6.04  9.06  38.23  76.10  114.3  171.32  
30  29.18  29.16  29.12  29.07  2.06  4.02  6.01  9.03  58.27  116.3  174.4  261.25  
50  49.30  49.16  49.13  49.12  2.03  4.01  6.03  8.97  97.9  196.3  294.3  441.27  
100  99.23  99.06  99.08  99.17  2.01  3.99  5.97  9.03  198.1  396.2  594.4  891.58 
Variation  Sum of absolute  Divisor  MAD estimate 

Block 




Treatment 




Within 


 
Total 

Variation  Sum of absolute  Divisor  MAD estimate 

Block 




Treatment 




Within 


 
Total 

Table 5. simulated critical right tail values for and using Laplace distribution for different and and the number of replications is 10000.
3  4  5  8  10  3  4  5  8  10  
10  3.01  2.58  2.50  2.26  2.25  4.41  3.46  3.08  2.48  2.25 
15  2.40  2.23  2.14  1.98  1.92  3.90  3.27  2.86  2.38  2.17 
20  2.12  2.00  1.92  1.83  1.77  3.78  3.15  2.81  2.31  2.15 
25  1.99  1.86  1.78  1.73  1.70  3.76  3.10  2.81  2.29  2.14 
30  1.84  1.76  1.70  1.65  1.64  3.73  3.08  2.78  2.28  2.11 
50  1.61  1.55  1.51  1.48  1.48  3.54  3.00  2.75  2.21  2.10 
100  1.40  1.38  1.34  1.33  1.32  3.42  2.99  2.73  2.20  2.10 
 
10  4.25  3.93  3.60  3.13  3.18  7.50  6.20  4.77  3.50  3.07 
15  3.94  3.17  2.80  2.63  2.49  6.99  5.24  4.40  3.28  2.88 
20  2.87  2.64  2.48  2.26  2.23  6.34  4.81  4.22  3.20  2.85 
25  3.00  2.35  2.25  2.14  2.08  6.23  4.74  4.15  3.10  2.84 
30  2.33  2.19  2.17  2.00  2.00  5.83  4.84  4.14  3.10  2.82 
50  1.96  1.88  1.80  1.74  1.72  5.65  4.65  4.05  3.07  2.77 
100  1.59  1.58  1.53  1.49  1.48  5.53  4.45  3.98  3.06  2.72 
Table 6. simulated critical right tail values for and using Laplace distribution for different and and the number of replications is 10000.
 
3  4  5  8  10  3  4  5  8  10  
10  2.73  2.36  2.27  2.04  2.02  3.79  3.02  2.69  2.17  2.02 
15  2.17  1.98  1.95  1.81  1.78  3.44  2.90  2.62  2.13  1.96 
20  1.96  1.81  1.76  1.67  1.64  3.31  2.79  2.51  2.10  1.94 
25  1.79  1.70  1.67  1.58  1.56  3.29  2.70  2.50  2.06  1.94 
30  1.70  1.64  1.58  1.52  1.52  3.25  2.69  2.48  2.05  1.91 
50  1.51  1.45  1.43  1.39  1.37  3.12  2.65  2.43  2.03  1.91 
100  1.33  1.31  1.29  1.26  1.25  3.03  2.62  2.42  2.02  1.90 
 
10  3.99  3.36  3.28  2.74  2.72  6.35  4.79  4.21  3.08  2.64 
15  3.12  2.68  2.56  2.32  2.28  5.90  4.64  3.99  2.84  2.61 
20  2.69  2.42  2.20  2.08  2.02  5.40  4.37  3.61  2.83  2.56 
25  2.38  2.15  2.07  1.91  1.89  5.24  4.11  3.50  2.77  2.51 
30  2.19  2.00  1.95  1.81  1.78  5.23  4.06  3.49  2.74  2.46 
50  1.81  1.72  1.65  1.60  1.60  4.82  3.87  3.48  2.72  2.46 
100  1.49  1.47  1.44  1.40  1.40  4.77  3.85  3.47  2.69  2.45 
4. Fitting Sampling Distributions
Two approaches are used to obtain the approximations of the sampling distributions for , , , and .
4.1. Simulation Approach
The following steps are used to obtain the critical values:
1. For any given design simulate data from Laplace distribution using large number .
2. Compute for each .
3. Use quantile function in software R to obtain the required quantile for .
Tables 5 and 6 give the simulated critical right tail values for , , and based on Laplace distribution for different and for and ..
4.2. Variance Gamma Approach
The random variable is said to have VarianceGamma (VG) with parameters , , if it has probability density function given by
where
Where is a modified Bessel function of the third kind; see, for example, [22], and [8].
Note that there are other versions of this distribution available but this version is chosen because there is a software package in R called gammavariance based on this version. The first two moments of this distribution are used to obtain a suitable fit for , , and . The first two moments are
This distribution is defined over the real line and has many distributions as special cases or limiting distributions such as Gamma distribution in the limit and , Laplace distribution as and and normal distribution as , and . By using the variances of ,and in Table a very good fitting could be obtained. This fitting is given in Table 8.
Table 7. simulated variances for , , and with different values of and from Laplace distribution and the number of replications is 10000.
 3  5  7  10  3  5  7  10 


 
10  1.132  0.572  0.417  0.410  3.482  1.124  0.629  0.391 
20  0.313  0.213  0.198  0.182  1.997  0.831  0.576  0.356 
30  0.188  0.141  0.124  0.120  1.816  0.800  0.545  0.345 
50  0.100  0.081  0.073  0.070  1.662  0.761  0.509  0.344 
100  0.048  0.039  0.035  0.034  1.570  0.777  0.505  0.352 

 
10  0.893  0.377  0.319  0.292  2.496  0.751  0.445  0.274 
20  0.270  0.152  0.139  0.123  1.473  0.601  0.396  0.245 
30  0.135  0.098  0.880  0.079  1.253  0.556  0.361  0.237 
50  0.071  0.056  0.051  0.046  1.129  0.527  0.361  0.235 
100  0.034  0.027  0.025  0.023  1.044  0.522  0.350  0.237 
Table 8. variance gamma distribution approximation to ratio ,, and by using the simulated first two moments.
Ratio  Variance gamma fitting 








Figure 1. histogram of and based on simulated data from Laplace distribution with VG distribution superimposed and (a) and (b) and (c) and and (d) and .
Figure 2. histogram of and based on simulated data from Laplace distribution with VG distribution superimposed and (a) and (b) and (c) and and (d) and .
Figures 1 and 2 show the histograms of , , and using simulated data from Laplace distribution with VG distribution superimposed for different values of and . It is clear that the variance gamma distribution gives a very good fit for the ratios.
5. Graphic Presentation
5.1. ANOMAD General Plot
This plot is for all groups to detect shifts in mean or median. The axis contains the index of the groups and the axis contains the heights for the sum of , and ) for each group. Separate curves are drawn for sums of and . The points on each curve are connected by lines. This graph should reflect the heights, shifts, and patterns among all groups.
5.2. ANOMAD Individual Plot
This plot is for each group to detect shift inside the group. The axis contains the index of the data for each group and the axis contains the heights, and for each value. Separate curves are drawn and . The points on each curve are connected by lines. This graph should reflect the heights, shifts and patterns in each group.
Figures 3, 4 and 5 show that:
1. When means or medians are equals the two lines will be near from each other and most likely that there will be interference among them or the treatment line may be down the within line; see, Figure 3 a0. In this case it will not be clear pattern in each group and the heights will be almost the same for on each group; see, Figure 3 a1, a2, a3, a4 and a5. This may be indicating a strong evidence for no shifting in means or medians.
2. When mean(s) or median(s) are not equals the treatment line will start to go up until it may be separated from the within line; see, Figure 5 a0. In this case it will be clear pattern in group(s) with clear different gaps or heights; see, Figue 5 a1,a2,a3,a4 and a5. It is clear that the group three has a different pattern from others. This may give a strong evidence for shift(s) in mean(s) or median(s).
3. If much more points of between line lies under within line with small gap; see, Figure 4 a0. In this case there is not enough evidence for shift and it will not be clear pattern in each group; see, Figure 4 a1, a2, a3, a4 and a5.
Figure 3. ANOMAD plot for simulated data from : (a0) all groups and (a1), (a2), (a3), (a4) and (a5) for each group and , . Red line is treatment and blue line is within.
Figure 4. ANOMAD plot for simulated four groups L(10,1) and one group : (a0) all groups and (a1), (a2), (a3), (a4) and (a5) for each group and , . Red line is treatment and blue line is within.
Figure 5. ANOMAD plot for simulated four groups L(10,1) and one group : (a0) all groups and (a1), (a2), (a3), (a4) and (a5) for each group and , . Red line is treatment and blue line is within.
6. Test for mean and median
For mean the null hypothesis is that
Blocks
Treatments
For median the null hypothesis is that
Blocks
Treatments
Bukhari is a food chain with four outlets in Bahrain. The owner is interested in determine if the average service quality at the four outlets is the same. Twelve people are selected and they asked to eat at each of the four outlets. The order of visits to the four outlets was randomized, but each customer visited each outlet one time. After each visit, each customer rated the service on a scale of 1 to 100. The data is given in Table 9.
To test for the assumption of Laplace distribution, the function laplace.test() in package lawstat in Rsoftware is used where it gives five goodness of fit for the Laplace distribution based on the work of [20]. Table 9 gives the sample data with means, medians, MAD and KolmogorovSmirnov (D) test for Laplace distribution. The results for the four groups are given in Table 9 where values more than 0.01, 0.05 and 0.10, therefore, the assumption of Laplace cannot be rejected. Because the maximum MAD to minimum MAD is 1.3, the assumption of homogeneity of MAD’s may not be rejected.
From Table 10, since the null hypothesis could not be rejected, .i.e., blocking is not effective while , therefore, the outlets are different in averages.
Figure 6 shows that
1. Most of the points of treatment line are above the within line with a big gap at the point 3. This might give a visual evidence of shift in average for group 3; see, Figure 6 a0.
2. The second group is stable while the first and fourth groups almost have the same patterns. The third group has pattern near from first and fourth groups but the gap is much more than the other groups. This may indicate that the third group is different from others; see, Figure 6 a1, a2, a3 and a4.
3. Table 11 shows that the block and treatment are significance in terms of equal medians. Care needs to be used in interpreting the implication of block effects.
Outlets  
Customer  O1  O2  O3  O4  means  Med.  
1  71  73  94  83  77.25  72.0  Laplace test(KS)  
2  72  75  81  78  75.00  73.5  pvalue 

 
3  90  81  92  74  88.25  90.0  O1  0.51  4.54  4.5 
4  74  77  64  81  72.25  74.0  O 2  0.34  4.67  4.7 
5  76  85  91  80  82.00  80.5  O3  0.51  6.00  6.1 
6  61  90  84  71  74.00  72.5  O4  0.50  4.53  4.5 
7  75  67  82  66  74.75  75.0  
8  73  78  89  76  78.25  75.5  
9  78  71  90  86  79.25  78.0  
10  73  76  85  89  76.75  74.5  
11  81  79  75  69  79.00  80.0  
12  78  72  88  79  79.00  78.0  
Means  75.2  77  84.6  75.1  78.91  
Med.  74.5  76.5  86.5  74.5  78 
Varia.  SA  Divisor  MAD est. 


Block  86.96  11.25  7.73  1.9  2.10 
Treatment  77.29  3.08  25.1  6.2  3.14 
Within  134.71  33.33  4.04  
Total  298.96 
*This value from VarianceGamma package in Rsoftware.
Vari.  SA  Divisor  MAD est. 


Block  94  11.25  8.35  2.60  1.93 
Treatment  96  3.08  31.17  9.71  2.80 
Within  107  33.33  3.21  
Total  297 
*This value from VarianceGamma package in Rsoftware.
Effect sizes
Effect sizes (ES) provide another measure of the magnitude of the difference expressed in standard variation units in the original measurement. Thus, with the test of statistical significance and the interpretation of the effect size (ES), the researcher can address issues of both statistical significance and practical importance. The most direct one is
where is the sum of squares. measures the proportion of the variation in that is associated with membership of the different groups defined by . is an uncorrected effect size estimate that estimates the amount of variance explained based on the sample, and not based on the entire population. has been suggested to correct for this bias as
See; for example, [3], [4], [18], [2] and [14].
These two measures could be extended to ANOMAD as
and
Where measures the proportion of MAD in that is associated with membership of the different groups defined by . For the above data, Table 12 gives the computations of these measures.
Using mean  Using median  



 
BLSA  0.291  0.137  0.31  0.19 
TRSA  0.258  0.214  0.32  0.29 
From Table 12, note that ANOMAD for testing equal median explains more variation in dependent variable than ANOMAD for testing equal mean.
7. Conclusion
The Laplace distribution provides a good approximation to many applications. In these cases, when the tests of equal means or medians are needed, the ANOMAD will be appropriate. The ANOMAD had a very important property where it had been extended to test for equal medians. Moreover, it had given weights to the data rather than square and that ensured stability in statistical inferences.
The ANOMAD had important information about the shifts in means and medians that studied by fitting variancegamma distribution to , , and and tested for equal means or medians. Also, it offered a very effective way to find out the shifts in means and medians graphically. Actually, the graph is a very strong point if one can obtain the right conclusion from it. Two effect size measures are extended to ANOMAD.
References