Dataplot Vol 2 Vol 1

# GINI MEAN DIFFERENCE

Name:
GINI MEAN DIFFERENCE (LET)
Type:
Let Subcommand
Purpose:
Compute the Gini mean difference for a variable.
Description:
Given a response variable $$X$$ with observations $$x_1, x_2, ..., x_n$$ sorted from low value to high value, the Gini mean difference is defined as:

$$\begin{array}{lcl} \mbox{GMD} & = & \frac{2}{n(n-1)} \sum_{i=1}^{n} {\sum_{j=1}^{i-1}{|x_{i} - x_{j}|}} \\ & = & \frac{2}{n(n-1)} \sum_{i=1}^{n-1} {i(n-i)x_{i+1} - x_{i}} \end{array}$$

where $$n$$ is the sample size.

The Gini mean difference was proposed by Gini (1912) and is the average absolute differences in all pairs of observations. Note that this is a measure of dispersion that does not depend on a measure of location.

Syntax:
LET <par> = GINI MEAN DIFFERENCE <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed Gini mean difference is stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET A = GINI MEAN DIFFERENCE Y1
LET A = GINI MEAN DIFFERENCE Y1 SUBSET TAG > 2
Note:
Dataplot statistics can be used in a number of commands. For details, enter

Default:
None
Synonyms:
None
Related Commands:
 GINI MEAN DIFFERENCE LOG RATIO = Compute the log of the ratio of the Gini mean differences of two samples. MEDIAN ABSOLUTE DEVIATION = Compute the median absolute deviation of a variable. AVERAGE ABSOLUTE DEVIATION = Compute the average absolute deviation of a variable. STANDARD DEVIATION = Compute the standard deviation of a variable. VARIANCE = Compute the variance of a variable. RANGE = Compute the range of a variable.
References:
Tena (2009), "Test Procedures for Equality of Two Variances in Delta Distributions," Dissertations, 695, https://scholarworks.wmich.edu/dissertations/695.

Gini (1921), "Measurement of Inequality in Incomes," The Economic Journal, 31, pp. 124-126.

Applications:
Data Analysis
Implementation Date:
2023/07
Program 1:

SKIP 25
.
BOOTSTRAP SAMPLES 10000
TITLE CASE ASIS
LABEL CASE ASIS
CASE ASIS
.
TITLE Bootstrap Plot for Gini Mean Difference
X1LABEL Bootstrap Sample
X2LABELDataset: ROSNER.DAT
Y1LABEL Gini Mean Difference
.
BOOTSTRAP GIN MEAN DIFFERENCE PLOT Y
.
LET LCL = ROUND(B025,3)
LET UCL = ROUND(B975,3)
JUSTIFICATION CENTER
MOVE 50 5
TEXT Lower 95% Confidence Limit: ^LCL, Upper 95% Confidence Limit: ^UCL
LINE DOTTED
LINE COLOR RED
DRAWSDSD 15 ^LCL 85 ^LCL
DRAWSDSD 15 ^UCL 85 ^UCL

The following output is generated

Bootstrap Analysis for the GINI MEAN DIFFERENCE

Response Variable One: Y

Number of Bootstrap Samples:                      10000
Number of Observations:                              50
Mean of Bootstrap Samples:                      1.13362
Standard Deviation of Bootstrap Samples:        0.16878
Median of Bootstrap Samples:                    1.13333
Minimum of Bootstrap Samples:                   0.55771
Maximum of Bootstrap Samples:                   1.71342

Percent Points of the Bootstrap Samples
-----------------------------------
Percent Point               Value
-----------------------------------
0.1    =        0.63803
0.5    =        0.71597
1.0    =        0.75432
2.5    =        0.81257
5.0    =        0.85786
10.0    =        0.91725
20.0    =        0.98941
50.0    =        1.13333
80.0    =        1.27518
90.0    =        1.35585
95.0    =        1.41879
97.5    =        1.47064
99.0    =        1.52013
99.5    =        1.56189
99.9    =        1.63985

Percentile Confidence Interval for Statistic

------------------------------------------
Confidence          Lower          Upper
Coefficient          Limit          Limit
------------------------------------------
50.00        1.01674        1.24562
75.00        0.93664        1.33103
90.00        0.85786        1.41879
95.00        0.81257        1.47064
99.00        0.71597        1.56189
99.90        0.61387        1.65573
------------------------------------------


Program 2:

SKIP 25
.
TITLE CASE ASIS
LABEL CASE ASIS
CASE ASIS
.
CHARACTER CIRCLE BLANK
CHARACTER HW 1 0.75
CHARACTER FILL ON
LINE BLANK SOLID
.
XLIMITS 1 10
MAJOR X1TIC MARK NUMBER 10
MINOR X1TIC MARK NUMBER 0
TIC MARK OFFSET UNITS DATA
X1TIC MARK OFFSET 0.5 0.5
.
Y1LABEL Gini Mean Difference
X1LABEL Batch ID
TITLE Gini Mean Difference Plot for GEAR.DAT
.
GINI MEAN DIFFERENCE PLOT Y X


Date created: 07/14/2023
Last updated: 07/14/2023