Announcement

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

  • test quadratic terms whether are statistically significant different in two different groups

    Hello,

    I am considering to do a test to test whether quadratic terms are statistically significant different in two groups. They are in the OLS model and it is unbalanced panel data. I am not sure which test I can use in STATA.

    Thanks in advance!

    Shuhui

  • #2
    It rarely makes sense to test just the coefficients of the quadratic terms for significant differences across groups without also testing the linear terms.

    Supposing the variable that your are including as a quadratic is called x and your outcome is called y, and your grouping variable is called group (coded 0/1):

    Code:
    regress y i.group#c.x##c.x // AND PERHAPS OTHER VARIABLES
    test 1.group#c.x 1.group#c.x#c.x
    will test for any difference of the linear or quadratic coefficients across groups.

    Comment


    • #3
      Hi Clyde,

      Thanks!!!

      But I am still a little confused.

      First of all, I understand that it is necessary to test the significance of linear terms.

      Secondly, the x is as the linear term, and x^2 is as the quadratic term. The grouping variable is called group.
      This is what I did before:
      regress y x x^2 if group==1
      regress y x x^2 if group==0

      Then to test the statistically significant, is it to combine the regress like you mentioned?

      regress y i.group#c.x##c.x (should I include i.group#c.x as well )

      And I do not understand the test command. Why do you use 1.group?

      Thanks a lot!

      Shuhui

      Comment


      • #4
        p.s another thing is that since it is necessary to winsor the quadratic terms. Can I still use this regress y i.group#c.x##c.x ?

        Comment


        • #5
          So, I made a mistake in the code, but I think your confusion is unrelated to my mistake. The correct code is:

          Code:
          regress y i.group##c.x##c.x // AND PERHAPS OTHER VARIABLES
          test 1.group#c.x 1.group#c.x#c.x
          The "perhaps other variables" just means that I don't know if you also intend to include variables other than the group and x (and x^2) in your model--you can if you want to.

          I think you need to learn about factor-variable notation in Stata and then you will understand what I have done. Read -help fvvarlist- and I think it will become clear how this code works.

          While I am not a fan of winsorizing variables, doing that would not change the way you would code this process.

          Comment


          • #6
            Sure. Appreciate!!!

            Comment

            Working...
            X