Thanks to Kit Baum. Version 2.0 of asreg is now available on SSC. To install or update it, type:
Details related to syntax and options with examples are listed on this page of my website : https://StataProfessor.com/stata-pro...ions-in-stata/

asreg can fit three types of regression models; (1) a model of depvar on indepvars using linear regression in a user's defined rolling window or recursive window (2) cross-sectional regressions or regressions by a grouping variable (3) Fama and MacBeth (1973) two-step procedure. asreg is order of magnitude faster than estimating rolling window regressions through conventional methods such as Stata loops or using the Stata's official rolling command. asreg has the same speed efficiency as asrol. All the rolling window calculations, estimation of regression parameters, and writing of results to Stata variables are done in the Mata language. asreg reports most commonly used regression statistics such as number of observations, r-squared, adjusted r-squared, constant, slope coefficients, standard errors of the coefficients, fitted values, and regression residuals.

Here, I would like to highlight only the updates in this version.

This version of asreg has option fmb. Option fmb applies a two-step Fama-MacBeth procedure. The first step involves estimation of N cross-sectional regressions and the second steps involves T time-series averages of the coefficients of the N-cross-sectional regressions. The standard errors are adjusted for cross-sectional dependence. This is generally an acceptable solution when there is a large number of cross-sectional units and a relatively small time series for each cross-sectional unit. However, if both cross-sectional and time-series dependencies are suspected in the data set, then Newey-West consistent standard errors can be used. asreg uses the first method as a default. To know more about this option, visit my web page

Option newey specifies the number of lags for estimation of Newey-West consistent standard errors. asreg allows option newey to be used in both the rolling regressions and Fama-MacBeth regressions. In the rolling regressions, newey will work only when option se is used. Also, please note that without using option newey, option se estimates normal standard errors of OLS.

This option is used in rolling regression, and hence it will work only when option window is specified. This option reports root-mean-square error of OLS regression

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 asreg has more than 6 routines in the Mata language that are meant for different data structures. Therefore, asreg 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.

Code:

ssc install asreg, replace

**Description**asreg can fit three types of regression models; (1) a model of depvar on indepvars using linear regression in a user's defined rolling window or recursive window (2) cross-sectional regressions or regressions by a grouping variable (3) Fama and MacBeth (1973) two-step procedure. asreg is order of magnitude faster than estimating rolling window regressions through conventional methods such as Stata loops or using the Stata's official rolling command. asreg has the same speed efficiency as asrol. All the rolling window calculations, estimation of regression parameters, and writing of results to Stata variables are done in the Mata language. asreg reports most commonly used regression statistics such as number of observations, r-squared, adjusted r-squared, constant, slope coefficients, standard errors of the coefficients, fitted values, and regression residuals.

Here, I would like to highlight only the updates in this version.

**1. Fama and MacBeth(1973) regression**This version of asreg has option fmb. Option fmb applies a two-step Fama-MacBeth procedure. The first step involves estimation of N cross-sectional regressions and the second steps involves T time-series averages of the coefficients of the N-cross-sectional regressions. The standard errors are adjusted for cross-sectional dependence. This is generally an acceptable solution when there is a large number of cross-sectional units and a relatively small time series for each cross-sectional unit. However, if both cross-sectional and time-series dependencies are suspected in the data set, then Newey-West consistent standard errors can be used. asreg uses the first method as a default. To know more about this option, visit my web page

**2. Newey-West standard errors**Option newey specifies the number of lags for estimation of Newey-West consistent standard errors. asreg allows option newey to be used in both the rolling regressions and Fama-MacBeth regressions. In the rolling regressions, newey will work only when option se is used. Also, please note that without using option newey, option se estimates normal standard errors of OLS.

**3. RMSE**This option is used in rolling regression, and hence it will work only when option window is specified. This option reports root-mean-square error of OLS regression

**4. 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 asreg has more than 6 routines in the Mata language that are meant for different data structures. Therefore, asreg 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.

## Comment