Dear STATA users,

I am using a foreach loop to regress four models across multiple variables. I need to test whether there are is a statistically significant difference between the intercept and coefficients for each possible pair of variables (e.g. whether the VWESTOT30 coefficients are different from the VWESTOB30 coefficients). I am not interested in the difference between intercepts or coefficients within the models (e.g. the difference between MktRF and SMB coefficients). Please see the example of the code I am using below.

foreach portfolio of varlist VWESTOT30 VWESTOB30 VWESAFT30 VWESAFB30 VWESAST30 VWESASB30 VWESEAT30 VWESEAB30 VWESMIT30 VWESMIB30 VWESNOT30 VWESNOB30 VWESPAT30 VWESPAB30 VWESSOT30 VWESSOB30 VWESWET30 VWESWEB30 {
//Regress CAPM
regress `portfolio' MktRF, robust
outreg2 `portfolio' MktRF using "I:\Outregs\ESCAPMVWTB30.xls", append
//Regress FF 3F Model
regress `portfolio' MktRF SMB HML, robust
outreg2 `portfolio' MktRF SMB HML using "I:\Outregs\ESFF3FVWTB30.xls", append
//Regress FF C Model
regress `portfolio' MktRF SMB HML MOM, robust
outreg2 `portfolio' MktRF SMB HML MOM using "I:\Outregs\ESCFFVWTB30.xls", append
//Regress FF 5F Model
regress `portfolio' MktRF SMB HML RMW CMA, robust
outreg2 `portfolio' MktRF SMB HML RMW CMA using "I:\Outregs\ESFF5FVWTB30.xls", append
}


Thank you very much in advance!