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
Collapsing two variables that occur multiple timesHi StataList, I'm attempting to collapse two variables, "from_gstin" and "to_gstin", into a form wh…
Creating biological and step families with the new ADD Health Parent DataHello Statalist! I am fairly new at analyzing data and I am hoping someone will be able to help me …
Any suggestions on addressing endogeneity while estimating Veblen Effect.How do I make sure that price coefficient is positive because the good is veblen or there is unadres…
An event study plot in STATA - multiple, staggered & temporary treatment with spillover effectsHello! Disclaimer - Apologies for any inconsistency in the posting format, I have read instructions…
Storing and graphing the lincom estimates (inside the loop)After running the regression, I did the lincom, and then stored the estimates (with local as well as…
Subscribe to:
Post Comments (Atom)
0 Response to Difference between variables' foreach loop regression coefficients
Post a Comment