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
Using foreach for two set of groupsDear All, I am working on a bilateral data of the form; exporter importer year trade Germany Franc…
Testing for difference in marginal effects at two values of same continuous independent variableHi all, and thanks in advance for any responses. I'm estimating the following model: mlogit enroll_…
Regression rich text file issueHello, I am attempting to transfer the regression to a rich text file. For some reason my regression…
XSMLE dynamic SDM where beta is constrained to = 0Dear list members, I have a special request estimating a dynamic spatial durbin model. I would like…
Importing variable with special characters, strings and numbersDear Stata users, I am experiencing problems in importing a variable from a csv file. This variable…
Subscribe to:
Post Comments (Atom)
0 Response to Difference between variables' foreach loop regression coefficients
Post a Comment