Announcement

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

  • How to interpret an output from -test-

    Dear all,

    I was sleepy when writing a code, and did something like that:

    Code:
    use http://www.stata-press.com/data/r13/census3
    regress brate medage c.medage#c.medage i.region
    test 1.region==2.region==3.region==4.region
    Actually, I was trying to test if all coefficients are jointly equal to 0:

    Code:
    test 2.region==3.region==4.region
    It seems odd, but my "mistake" seems to be very interesting in my simulations. Hence, my question is : what does the term 1b.region mean?

    test 1.region==2.region==3.region==4.region

    ( 1) 1b.region - 2.region = 0
    ( 2) 1b.region - 3.region = 0
    ( 3) 1b.region - 4.region = 0

    F( 3, 44) = 8.85
    Prob > F = 0.0001

    I will be very thankful for any comments.

    All the best,

    Tiago
    Last edited by Tiago Pereira; 20 Mar 2017, 20:56.

  • #2
    See -help fvvarlist- and the associated manual section to get a better understanding of factor-variable notation.

    In that data set, the variable region takes on values 1, 2, 3, and 4. When you specify i.region, Stata creates three virtual indicator variables for three of the regions, leaving one as a reference or base category. Since you didn't explicitly tell Stata which one to use as the base category, it chose 1. So the b after the 1 means that 1 is the reference category, the one which has no indicator variable associated with it in the regressions. (You can see that in the regression output: coefficients are given for NCentral South and West, which are the labels for 2, 3, and 4, respectively. But there is no coefficient shown for NE, which is the label for 1.

    To test whether your coefficients are all jointly zero, the simplest code is:

    Code:
    testparm i.region
    Stata will expand this into a test that all of the coefficients (except that of 1b.region) are zero. There is no need to test whether 1b.region's coefficient is zero because, as the omitted reference category, it has no coefficient. (Alternatively, you can think of it has having a coefficient that is constrained to be zero.)

    Comment


    • #3
      Thank you so much, Clyde. As usual, your explanations are extremely clear and useful.

      All the best,

      Tiago

      Comment

      Working...
      X