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
Centering variablesHello, I have 16 countries across 30+years. My variables are slightly multi collinear as I have GDP…
Using inlist when with multiple & and or ( | ) statements to create dummies within a loopHello, In trying to clean up my code, I've run into a roadblock. I'm trying to create a dummy variab…
How to identify households with all members with no incomeDear All, I want to know how we check whether in each HH there is at least one member with income (…
Stacked bar: blabel using a different variableI am trying to create a stacked bar plot: Code: graph bar x1 x2, over(group) Command - Code: blabe…
working with multi‐episode event history datasetAnyone with some experience working with multi‐episode event history dataset ? …
Subscribe to:
Post Comments (Atom)
0 Response to Difference between variables' foreach loop regression coefficients
Post a Comment