Version 4.5.1 dated December 11, 2018, of

This version of asrol improves the calculation of the product of values and the geometric mean. Since both the statistics involve the multiplication of values in a given window, the presence of missing values and zeros present a challenge to getting the desired results. Following are the defaults in asrol to deal with missing values and zeros:

7.1 : Missing values are ignored when calculating the product or the geometric mean of values.

7.2 : To be consistent with Stata's default for geometric mean calculations, (see ameans), the default in asrol is to ignore zeros and negative number. So
And

7.3 : Zeros are considered when calculating the product of values. So

Two variations are possible when we want to treat zeros differently. These are discussed below:

7.4 Option

7.5 Option
and the
The Stata's ameans command calculates three types of means, including the geometric mean. The difference between asrol' gmean function and the Stata ameans command lies in the treatment of option

**asrol**is now available on SSC (thanks to Kit Baum as usual). This version improves the calculation of geometric mean and products. A detailed blog post with relevant examples can be found on my website here. Below is an excerpt from the asrol help file concerning the new changes.This version of asrol improves the calculation of the product of values and the geometric mean. Since both the statistics involve the multiplication of values in a given window, the presence of missing values and zeros present a challenge to getting the desired results. Following are the defaults in asrol to deal with missing values and zeros:

7.1 : Missing values are ignored when calculating the product or the geometric mean of values.

7.2 : To be consistent with Stata's default for geometric mean calculations, (see ameans), the default in asrol is to ignore zeros and negative number. So

Code:

the geometric mean of 0,2,4,6 is 3.6342412, that is [2 * 4 * 6]^(1/3).

Code:

the geometric mean of 0,-2,4,6 is 4.8989795, that is [4 * 6]^(1/2).

7.3 : Zeros are considered when calculating the product of values. So

Code:

the product of 0,2,4,6 is 0

Two variations are possible when we want to treat zeros differently. These are discussed below:

7.4 Option

**ignorezero**: This option can be used to ignore zeros when calculating the product of values. Therefore, when the zero is ignored,Code:

the product of 0,2,4,6 is 48

7.5 Option

**add(#):**This option adds a constant**#**to each value in the range before calculating the product or the geometric mean. Once the required statistic is calculated, then the constant is subtracted back. So using option add(1), tCode:

the product of 0,.2,.4,.6 is 1.6880001 = [1+0 * 1+.2 * 1+.4 * 1+.6] - 1

Code:

geometric mean is .280434 = [(1+0 * 1+.2 * 1+.4 * 1+.6)^(1/4)] - 1.

**add(#)**. ameans does not subtract the constant # from the results, whereas asrol does.
## Comment