Thanks to Kit Baum, the updated version of asreg is now available on the SSC. The new version is version: 4.2; Date Jan 31, 2021.
Following are the key highlights of the new version

1. Changes made to the window() option
Version 4.0 of asreg introduces a more flexible window to identify observation in a given range. Previously, the window() option of asreg would take two inputs: the first one as the range variable (such as date) and the second one as the length of the rolling window. In the older versions, the window would always look backward. This has changed in version 4.0.

The window argument can now take up to three arguments. The window can now look backward, forward, and both back and forward. More details can be read in the help file under the option window()

2. Improved algorithm for rolling window indices
This version of asreg (version 4.0) significantly improves the calculation speed of the required statistics, thanks to the development of a more efficient algorithm for extracting rolling window indices. This has resulted in a significant speed advantage for asreg compared to its previous versions or other available programs. The speed efficiency matters more in larger datasets.

3. Exclude observations with option exclude()
Option exclude() can be used to exclude specific observations from regressions. This option requires three arguments, with or without using the comma character. The first is the range variable such as daily, weekly, monthly or yearly date; the second and third arguments are the lower and upper bounds of the range variable. The definitions and working of option exclude(rangevar #low #high) are similar to that of the option window(rangevar #from #upto).

Examples:

Example 1: Regression for each company in a rolling window of last 10 years

Code:
    . webuse grunfeld, clear
 
    . bys company: asreg invest mvalue kstock, wind(year 10)
OR

Code:
    . bys company: asreg invest mvalue kstock, wind(year -10 0)

Example 2: Regression for each company in a rolling window of 10 years; 5 past and 5 forward

Code:
 . bys company: asreg invest mvalue kstock, wind(year -5 5)

Example 3: Regression for each company in a rolling window of 10 leading years

Code:
  . bys company: asreg invest mvalue kstock, wind(year 0 10)
Example 4: Regression for each company in a recursive window

.
Code:
webuse grunfeld, clear
 
    . bys company: asreg invest mvalue kstock, wind(year 10) rec
OR

Code:
. bys company: asreg invest mvalue kstock, wind(year 1000)

Example 5: Using option minimum - Limit regression to a minimum of 5 observations

.
Code:
 webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) min(5)


Example 6: Reporting standard errors

Code:
  . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) se

Example 7: Newey-West standard errors, lag(1)

Code:
. webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) se newey(1)

Example 8: Robust standard errors

Code:
  . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) robust


Example 9: Reporting standard errors, fitted values and residuals

Code:
    . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) se fit

Example 10: Regressions without constant

Code:
 . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, wind(year 10) noc


Example 11: No window - by groups regressions

Code:
  . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock


Example 12: Yearly cross-sectional regressions

Code:
    . webuse grunfeld, clear
 
 . bys year: asreg invest mvalue kstock

Example 13: Rolling regression - reporting RMSE

Code:
  . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, w(year 10) rmse

Example 14: Fama and McBeth Regression

Code:
  . webuse grunfeld, clear
 
 . asreg invest mvalue kstock, fmb
Example 15: Fama and McBeth Regression - using Newey-West errors

Code:
. webuse grunfeld, clear
 
 . asreg invest mvalue kstock, fmb newey(1)

Example 16: Fama and McBeth Regression - report first stage regression

Code:
  . webuse grunfeld, clear
 
 . asreg invest mvalue kstock, fmb first

Example 17: Fama and McBeth Regression - save first stage results

Code:
. webuse grunfeld, clear
 
    . asreg invest mvalue kstock, fmb save(FirstStage)

Example 18: Exclude focal observation in cross-sectional regressions

Code:
  . webuse grunfeld, clear
 
 . bys company: asreg invest mvalue kstock, exclude(year 0 0)
Example 19: Exclude 5 most recent observations (the focal observation and 4 others from the recent past)

Code:
 . webuse grunfeld, clear
 
    . bys company: asreg invest mvalue kstock, exclude(year -4 0)
For more discussion and example, visit the asreg webpage https://fintechprofessor.com/2017/12...ions-in-stata/