.

*! v1.2 CMUrzua 30 May 2022

Title

pwlaw -- Given a column vector of data, calculate a test statistic for power-law behavior

Syntax

pwlaw
[varname]

[,
option]

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

Description

Given the column vector varname, pwlaw calculates the statistic proposed in Urzúa (2020) to test for power-law behavior. Since under the null PWL 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 100, it is better to use the critical values given in Table 1 of that paper.

Remarks

The statistical test is locally optimal if the possible alternative distributions are contained in the Pareto Type (IV) family. The last output of the program provides a maximum-likelihood estimate of the shape parameter alpha. If the null hypothesis of power-law behavior cannot be rejected, this estimate may be of some interest. But if the null is rejected, then alpha is not the only parameter that determines the tail of the distribution.

Using the PWL test, Urzúa (2020) examines four classical data sets: the frequency of occurrence of unique words in Moby Dick; the human populations of US cities; the frequency of occurrence of US family names; and the peak gamma-ray intensity of solar flares.

If the researcher is interested on testing in particular for Zipf's law, the LMZ test proposed in Urzúa (2000) can be used for that end. It can be calculated using the software program lmztest in the SSC Archive.

Examples

. pwlaw words, mu(6)

. pwlaw cities, mu(52360)

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. 2020. A simple test for power-law behavior. Stata Journal vol. 20, no. 3, pp. 604-612.