help anogi-------------------------------------------------------------------------------

Title

anogi-- Analysis of Gini

Syntax

anogivarname[if] [in] [weight],by(groupvar)[detailnolabelfjiojivce(vcespec)]

fweights,aweights, andpweights are allowed; see weight.

Description

anogicomputes the "Analysis of Gini" for population subgroups proposed by Frick et al. (2006).

Requirements

anogirequiresmoremata. To install the package, type. ssc describe moremata

Options

by(groupvar)defines the groups over which the Gini be decomposed.groupvarmay be numeric or string.

detaildisplays detailed results for the subgroups.

fjicauses the matrix of average between-group ranks to be displayed.

ojicauses the matrix of between-group overlapping indices to be displayed.

nolabelcauses the numeric codes of the groups to be displayed rather than the value labels.

vce(vcetype[,vceopts])indicates that standard errors be estimated.vcetypeis eitherbootstraporjackknife.fweights andaweights are not allowed ifvce()is specified.The following

vceoptsare available:

strata(varname)specifies a variable that identifies strata. If this option is specified, bootstrap samples are taken independently within each stratum / stratified jackknife estimates are produced.

cluster(varname)specifies a variable that identifies sample clusters. If this option is specified, the sample drawn during each bootstrap replication is a sample of clusters / clusters are left out for jackknife estimation.

nodotssuppresses display of the replication dots. By default, a single dot character is displayed for each successful replication. A single red 'x' is displayed, if a replication is not successful.

mseindicates that the variances be computed using deviations of the replicates from the estimate based on the entire dataset. By default, variances are computed using deviations from the average of the replicates.Additional option for

vce(jackknife):

fpc(varname)requests a finite population correction for the variance estimates. The values invarnameare interpreted as stratum sampling rates. The values must be in [0,1] and are assumed to be constant within each stratum.Additional option for

vce(bootstrap):

reps(#)specifies the number of bootstrap replications to be performed. The default is 50. More replications are usually required to get reliable results.reps()is only allowed whenvcetypeisbootstrap.

Examples. set obs 100 obs was 0, now 100

. generate x = invnormal(uniform())^2 . generate g = (x + uniform()) >= 1 . anogi x, by(g) Analysis of Gini

-------------------------------------------------- | Coef. % --------------------------+----------------------- Overall Gini | .6108943 100.00 | G_wo = sum s_i*G_i*O_i | .3548043 58.08 G_b | .25609 41.92 | IG = sum s_i*G_i | .4922952 80.59 IGO = sum s_i*G_i(O_i-1) | -.1374909 -22.51 BGp = G_bp | .3427792 56.11 BGO = G_b - G_bp | -.0866893 -14.19 --------------------------+----------------------- Mean of x | .7756576 N. of obs | 100 N. of subgroups | 2 --------------------------------------------------

. ret list

scalars: r(N) = 100 r(mean) = .7756576325441711 r(k) = 2

matrices: r(b) : 1 x 7 r(stats) : 2 x 7 . anogi x, by(g) vce(jack) Jackknife replications (100) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................................................. 50 .................................................. 100

Analysis of Gini

------------------------------------------------------------- | Coef. Std.Err. % --------------------------+---------------------------------- Overall Gini | .6108943 .0484469 100.00 | G_wo = sum s_i*G_i*O_i | .3548043 .0482766 58.08 G_b | .25609 .0443328 41.92 | IG = sum s_i*G_i | .4922952 .0567645 80.59 IGO = sum s_i*G_i(O_i-1) | -.1374909 .0316388 -22.51 BGp = G_bp | .3427792 .037861 56.11 BGO = G_b - G_bp | -.0866893 .0221666 -14.19 --------------------------+---------------------------------- Mean of x | .7756576 N. of obs | 100 N. of subgroups | 2 -------------------------------------------------------------

. eret list

scalars: e(N) = 100 e(df_r) = 99 e(mean) = .7756576325441711 e(k) = 2

macros: e(cmd) : "anogi" e(properties) : "b V"

matrices: e(b) : 1 x 7 e(V) : 7 x 7 e(stats) : 2 x 7 . test _b[BGO]=0

( 1) BGO = 0

F( 1, 99) = 15.29 Prob > F = 0.0002

Saved ResultsSee examples above. Results are returned in

r(), unlessvce()is specified, in which case results are returned ine().bis a matrix containing the overall decomposition results.statsis a matrix containing the subgroup results. Iffjiis specified,F_jicontains the matrix of mean ranks. Ifojiis specified,O_jicontains the matrix of overlapping indices.

Methods and FormulasThe implementation deviates from the description in Frick et al. (2006) in that 1/n is used in the formula for the Gini instead of 1/(n-1).

ReferencesFrick, J. R., Goebel, J., Schechtman, E., Wagner, G. G., Yitzhaki, S. (2006). Using Analysis of Gini (ANOGI) for Detecting Whether Two Subsamples Represent the Same Universe. The German Socio-Economic Panel Study (SOEP) Experience. Sociological Methods and Research 34:427-468.

AuthorsBen Jann, ETH Zurich, jann@soz.gess.ethz.ch

Tom Masterson, Levy Economics Institute of Bard College, masterso@levy.org

You may cite this software as follows:

Jann, B., and T. Masterson (2007). anogi: Stata module to generate Analysis of Gini. Available from http://ideas.repec.org/c/boc/bocode/s456730.html.

Also seeOnline:

moremata,mata mm_gini()