Announcement

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

  • Interaction term using dummy variable

    Hello everyone. I am trying to use the following model specification for my panel data analysis and my years are from 2000-2020.
    ROAit = αi +β1Sizeit+β2Agei+ β2Leverageit+B4ETRit+ µit

    where ETR is the effective tax rate.

    I want to do a pre and post corporate tax cut effect for the year 2011 since it had the highest corporate tax cut.
    Can this be done ?
    What will be the stata code to use the year and the independent variable as a interaction term to study its effect on profitability?


  • #2
    Hi Anuradha,

    In the context of your problem, it is indeed possible to study the effect of tax cut on RoA. For that, you shall have to first decide whether this tax cut affected the intercept (i.e. did tax cut change the level of RoA for firms altogether in the post-tax cut period compared to the pre-tax cut period?) or it affected the slope coefficient for any of your explanatory variables (i.e. did tax cut change the effect of X on Y in the post-tax cut period compared to the pre-tax cut period?) or the tax cut affected both intercept and slope coefficient(s)? This is a theoretical call that you shall have to take based on the understanding of the problem at hand.

    Anyway, you should first create a dummy variable which divides your time period into two parts: pre-tax cut and post-tax cut. Here's the command for the same:

    Code:
    . gen Post = 0
    
    . replace Post = 1 if Year>2011
    Now you have a dummy variable which takes the value of 1 if your time identifier (say, Year) is greater than 2011 and 0 otherwise.

    Supposing that you are using a standard fixed effects estimator to obtain your estimates and that you want to see the effect of tax cut on intercept and slope coefficient of ETR, you may use the following command:

    Code:
    xtreg RoA Size Age Leverage ETR Post#c.ETR Post, fe
    Further, in order to understand use of factor variables in Stata, please read section 25.2.10 from the following extract of Stata Manual:

    https://www.stata.com/manuals13/u25.pdf



    Comment


    • #3
      Thank you so much Sir Prateek Bedi . I will look into this accordingly.

      Comment


      • #4
        Anuradha:
        Prateek's helpful code can be made shorter via the following (-fvvarlist-) notation:
        Code:
        xtreg RoA Size Age Leverage i.Post##c.ETR, fe
        Although the -i.- prefix is redundant with a two-level categorical variable, I think that is a good habit to use it always, so that including it becomes automatic whenever you create categorical variables, regardless the number of their levels.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks Carlo Lazzaro for your valuable, helpful and absolutely correct advice! I completely agree with you!

          Comment


          • #6
            Thank you indeed Prateek Bedi for the helpful code: I've just made a bit of fine-tuning!
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you for coming to my rescue all the time Carlo Lazzaro Prateek Bedi .

              Comment


              • #8
                Dear Carlo Lazzaro ,
                I am new in this platform- so sorry if this is not the way to request support. You mentioned using "i." for categorical variables and interactions. When I am using the command "reg", I can use the i. in front of my categorical variables, but when I am using the command mvprobit command, then I get the message factor-variable and time-series operators not allowed; or when I have created a categorical variable using g(), I tried to call the variable categories in the mvprobit model and it did not work. What am I doing wrong?

                name of variable= yfarm_category= to 6 categories
                *creating dummies for yfarm_category ****
                tab yfarm_category, g(yfarmcateg_) -- up to here I see the changes in my dataset

                but when mvprobit command is used:

                mvprobit(Mulch_WSA= constraint_dummy gender1 education_dummy_1 clean_hhsize i.yfarm_category landtenure_dummy_1) /// Mulch_WSA
                (Nutrients_WSA= constraint_dummy gender1 constraint_gender education_dummy_1 i.yfarm_category clean_hhsize landtenure_dummy_1) ///
                (Soil_WSA= constraint_dummy gender1 constraint_gender education_dummy_1 i.yfarm_category clean_hhsize landtenure_dummy_1) ///Soil_WSA
                (Worm_WSA= constraint_dummy gender1 constraint_gender education_dummy_1 i.yfarm_category clean_hhsize landtenure_dummy_1), dr(10) dif iterate (10) technique (bfgs) nolog vce(cluster community)
                error message: factor-variable and time-series operators not allowed


                Comment


                • #9
                  Aide:
                  welcome to this forum.
                  The community-contributed module -mvprobit- (as you're kindly requested to mention it, for many good reasons covered in the FAQ, that you're kindly requested to read to post more effectively and increase your chances of getting helpful replies. Thanks), being a bit old, does not support -fvvarlist- notation.
                  Therefore, to include categorical variable you shou prefix your code with the -xi:- prefix, whereas interactions should be created by hand.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment

                  Working...
                  X