Thanks to Kit Baum, version 4 of ASROL is available on SSC now. New users can install it by

and existing users can update the version by

Major Updates

There are several major updates which I would like to highlight here

1. Rolling window algorithm

Since real-life data can come in a variety of structures, a static code for extracting the rolling-window from the data is always costly in terms of time. This version of

2. More statistics

This version of asrol has the following additional statistics :

2.2

2.3

3. Excluding focal observations

There might be circumstances where we want to exclude the focal observation while calculating the required statistics.

4. By group statistics

The option window is optional in this version of

5. The bysort prefix

Earlier version of asrol would accept only option by(varlist). This version accepts two options for group statistics: i.e. by(varlist) (specified after comma) and bysort varlist used as a prefix to the asrol command. The bysort prefix is faster than the other option.

6. Speed Efficiency

And above all, this version is way faster than all previous versions of asrol. Those who are interested can compare the speed of this version with the earlier version using data sets which are posted here https://www.statalist.org/forums/for...peed-advantage

Thanks to Nick Cox who reported a small bug in the calculation of median in version 3 of asrol. This version has fixed that bug. I would really appreciate comments for further improvement of asrol.

Code:

ssc install asrol

Code:

adoupdate asrol, update

Major Updates

There are several major updates which I would like to highlight here

1. Rolling window algorithm

Since real-life data can come in a variety of structures, a static code for extracting the rolling-window from the data is always costly in terms of time. This version of

**asrol**has more than 6 routines in the Mata language that are meant for different data structures. Therefore,**asrol**speed efficiency is ensured whether the data is rectangular (balanced panel), non-rectangular, has duplicates, has missing values, or has both duplicates and missing values.2. More statistics

This version of asrol has the following additional statistics :

**2.1 Percentiles :**Option**perc(k)**can be used alongside**stat(median)**to find k-th percentile of the values in range.2.2

**product**: This option can be used to multiply all the numbers in a given window2.3

**gmean**: This option finds the geometric mean of positive values in a given window3. Excluding focal observations

There might be circumstances where we want to exclude the focal observation while calculating the required statistics.

**asrol**now allows excluding focal observation with two flavors. The first one is to exclude only the current observation while the second one is to exclude all observation of the relevant variable if there are similar (duplicate) values of the rangevar elsewhere in the given window. The help file (help**asrol**) has examples to explain these two options in more details.4. By group statistics

The option window is optional in this version of

**asrol**. Hence, it can be dropped altogether. Therefore,**asrol**can be used for finding statistics over groups with or without using rolling window. Without the option window,**asrol**generates statistics just like egen command. When used with bys prefix (see below more details),**asrol**can closely match the speed of egen.5. The bysort prefix

Earlier version of asrol would accept only option by(varlist). This version accepts two options for group statistics: i.e. by(varlist) (specified after comma) and bysort varlist used as a prefix to the asrol command. The bysort prefix is faster than the other option.

6. Speed Efficiency

And above all, this version is way faster than all previous versions of asrol. Those who are interested can compare the speed of this version with the earlier version using data sets which are posted here https://www.statalist.org/forums/for...peed-advantage

**Acknowledgements**Thanks to Nick Cox who reported a small bug in the calculation of median in version 3 of asrol. This version has fixed that bug. I would really appreciate comments for further improvement of asrol.

## Comment