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!
Related Posts with Difference between variables' foreach loop regression coefficients
Splitting up survival analyses by follow-up timeHi all, I have a dataset I am analysing using survival analyses, with multiple records per patient.…
Creating local (or global) macro of past date (or range), in DDNNCCYY formatHi, I am trying to save a date range as a macro. I have it working to a degree with: Code: su dat…
Multiple imputations: Predicting missing for selected categoriesHi I'm currently trying to use multiple imputation for a register based cohort analysis on maternal…
reghdfe, clustering and crit. values -> adjusted?Dear all, I am using reghdfe and have few clusters. Throughout, I Wild-Cluster bottstrap my p-value…
Combining/Merging Duplicate ObservationsHi all, I have a dataset containing over 300'000 observations and have identified a few (1'725) dupl…
Subscribe to:
Post Comments (Atom)
0 Response to Difference between variables' foreach loop regression coefficients
Post a Comment