*! v1.1 CMUrzua 30 May 2022

Title

lmztest -- Given a column vector of data, calculate a test statistic for Zipf's law

Syntax

lmztest
[varname]

[,
option]

mu(#) Value of mu. Only the observations greater or equal than mu are used; mu >= min(varname).

Description

Given the column vector varname, lmztest calculates the statistic proposed in Urzúa (2000) to test for Zipf's law. Since under the null hypothesis LMZ is asymptotically distributed as a chi-squared with two degrees of freedom, the p-value is calculated accordingly. But if the number of observations is less or equal than 30, it is better to use the critical values given in Table 1 of that paper.

Remarks

It is not advisable to test for Zipf's law by means of a regression (Urzúa, 2011). The LMZ test is locally optimal if the alternative distributions also exhibit a power-law behavior. More generally, one could try to test first for power-law behavior by means of the PWL test (Urzúa 2020), which can be calculated using the software program pwlaw in the SSC Archive.

Example

. lmztest uscities, mu(100000)

References

Urzúa, C. M. 2000. A simple and efficient test for Zipf´s law. Economics Letters vol. 66, pp. 257-260.

Urzúa, C. M. 2011. Testing for Zipf´s law: A common pitfall. Economics Letters vol. 112, pp. 254-255.

Urzúa, C. M. 2020. A simple test for power-law behavior. Stata Journal vol. 20, no. 3, pp. 604-612.