Thanks to Kit Baum, version 3 of ASROL is available on SSC now. New users can install it by
and existing user can update the version by
.
Description
asrol calculates descriptive statistics in a user's defined rolling-window. asrol efficiently
handles all types of data structures such as data declared as time series or panel data,
undeclared data, or data with duplicate values, missing values or data having time series
gaps.
asrol uses efficient codings in the Mata language which makes this version extremely fast as
compared to other available programs. The speed efficiency matters more in large data sets.
This version also overcomes limitation of the previous version of asrol which could calculate
statistics in a rolling window of 104. This new version can accommodate any length of the rolling
window.
Speed Comparison
On panel and time series data, ASROL and RANGESTAT ( from SSC) perform pretty well, with marginal speed efficiency for ASROL. However, ASROL outperforms RANGESTAT significantly in panels with duplicate observations. See results of the following tests using Stata 14.2 on about 5 million observations. I have not tested using different windows as of now.
Code:
ssc install asrol,
Code:
adoupdate asrol
Description
asrol calculates descriptive statistics in a user's defined rolling-window. asrol efficiently
handles all types of data structures such as data declared as time series or panel data,
undeclared data, or data with duplicate values, missing values or data having time series
gaps.
asrol uses efficient codings in the Mata language which makes this version extremely fast as
compared to other available programs. The speed efficiency matters more in large data sets.
This version also overcomes limitation of the previous version of asrol which could calculate
statistics in a rolling window of 104. This new version can accommodate any length of the rolling
window.
Speed Comparison
On panel and time series data, ASROL and RANGESTAT ( from SSC) perform pretty well, with marginal speed efficiency for ASROL. However, ASROL outperforms RANGESTAT significantly in panels with duplicate observations. See results of the following tests using Stata 14.2 on about 5 million observations. I have not tested using different windows as of now.
Code:
clear set obs 1000 gen industry=_n gen year=_n+1917 expand 5 bys industry: gen country=_n expand 1000 bys ind: gen company=_n gen profit=uniform() tsset company year timer clear timer on 1 asrol profit, s(mean) w(100) timer off 1 timer on 2 rangestat (mean) profit, interval(year -99 0) by(company) timer off 2 timer list /* 1: 119.22 / 1 = 119.2250 2: 130.56 / 1 = 130.5600 */ cap drop mean100_profit profit_mean timer clear timer on 1 asrol profit, s(mean) w(year 100) by(country industry) timer off 1 timer on 2 rangestat (mean) profit, interval(year -99 0) by(country industry) timer off 2 assert mean100_profit== profit_mean timer list 1: 40.98 / 1 = 40.9840 2: 681.49 / 1 = 681.4930
Comment