Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Absorbing fixed effects in constrained regression (or a way not to save fixed effects to excel)

    Dear forum members,

    I need to run a constrained regression model for different dvs. The regression has multiway fixed effects (ibn.zipcode#ibn.products) and there are around 400 zip codes and 26 products.
    Is there a way to absorb the fixed effects so it runs faster like in reghdfe , absorb(ibn.zipcode#ibn.products)?


    Code:
    cnsreg log_revenue  ibn.zipcode#ibn.products  i.date  tt_5 tt_4 tt_3 tt_2 tt0 tt1 ht_5 ht_4 ht_3 ht_2 ht0 ht1 at_5 at_4 at_3 at_2 at0  b(0).products_t_5  b(0).products_t_4 b(0).products_t_3 b(0).products_t_2 b(0).products_t0 b(0).products_t1 , nocons constraints(11 10 2 3 4 5) collinear vce(cluster zipcode)
    
    where
    tt_5 tt_4 tt_3 tt_2 tt0 tt1 ht_5 ht_4 ht_3 ht_2 ht0 ht1 at_5 at_4 at_3 at_2 at0 are store-specific time to opening dummies
    b(0).products_t_5  b(0).products_t_4 b(0).products_t_3 b(0).products_t_2 b(0).products_t0 b(0).products_t1 are product-specific time to opening dummies
    constraints are
    1.products_t_5+...+26.products_t_5=0 (constraint 5)
    1.products_t_4+...+26.products_t_4=0 (constraint 4)
    1.products_t_3+...+26.products_t_3=0 (constraint 3)
    1.products_t_2+...+26.products_t_2=0 (constraint 2)
    1.products_t0+...+26.products_t0=0 (constraint 10)
    1.products_t1+...+26.products_t1=0 (constraint 11)
    Last edited by Shae Cetinel; 26 May 2022, 13:28.

  • #2
    (or a way not to save fixed effects to excel)
    See the -drop()- or -indicate()- options in

    Code:
    ssc install estout

    Comment

    Working...
    X