Home Forums ASREG : Rolling window and Fama-MacBeth Regressions How Create size-based portfolios and estimate cross-sectional regressions

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Inromi Zack
    Guest
    Post count: 118

    I want to two groups based on size of the firm. The groups should be based on median size of firms in each year. Then I want estimate a cross-sectional regression by year and the size-based groups. I wonder how the setup would look like and would be thankful if someone can share the Stata code
    Thank you.

    Attaullah Shah
    Keymaster
    Post count: 69

    If you want to create two groups of firms in each year, then something like the following will work:

    * For creating two groups of firms in each year, I am using astile. More on astile here

    ssc install astile, replace
    
    *Download example data
    webuse grunfeld, clear
    
    *Create two groups based on mvalue
    bys year: astile size = mvalue, nq(2)
    
    *Cross-sectional regression
    *For Cross-sectional regression, install asreg, more on asreg here
    
    ssc install asreg, replace
    
    *Yearly cross-sectional regression for each size group
    bys size year: asreg  invest mvalue kstock
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.