Announcement

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

  • Comparison of quarter dummy variables to a specific quarter

    Hi,

    my dataset contains quarter dummy variables from 2014q1 to 2017q1. If I want to compare the effect on the dependent variable for each quarter relative to 2016q1, is there any other way to compare these quarters without creating a categorical dummy variable that is equal one for 2014q1, equal two for 2014q2, ... equal 13 for 2017q1, and otherwise zero (for 2016q1)?

    Many thanks in advance and kind regards!

  • #2
    I assume you are planning to do this effect estimation using some kind of regression command. In that case, unless you are using some prehistoric version of Stata, there is never any need to create dummy variables. Instead, we use factor-variable notation. (Read -help fvvarlist- for explanation and details.) I assume you still have a single variable, let's call it qdate, which takes on the values 2014q1 through 2017q1 as a Stata quarterly date variable. Now, first we determine what the numeric value corresponding to 2016q1 is:
    Code:
    . display tq(2016q1)
    224
    Then our regression command would be something like:
    Code:
    regression_command dep_var other_ind_vars ib224.qdate ...
    Stata will expand ib224.qdate into a series of indicator ("dummy") variables, with 224 (i.e. 2016q1) as the reference category, so all the other qdate coefficients are effects relative to that quarter.

    Comment

    Working...
    X