Announcement

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

  • F test after regression using factor variables

    Hi Stata list,

    I am trying to perform a post estimation partial-F (Chow) test after a regression specified using a factor variable.

    I have a model of the effect of price on the probability of purchase of different goods. Since the level of purchase and the effect of price may both differ by the good, I estimate a different intercept and slope for each good (a specific type of fixed effect model, I think). Here's the code:

    Code:
    glm yvar_ind c.price##i.good, family(binomial) link(probit)
    I'd like to test whether the slopes for the different goods really differ. Per http://www.jblumenstock.com/files/co...4/FEModels.pdf, I am performing the
    partial-F (Chow).

    To do this after running the regression what is the appropriate code. Is it just:
    Code:
    test c.price#i.good
    Thanks!
    I am using Stata SE x64 ver 13.1 with Win 7 x64 and with 8 GB of ram.

  • #2
    Assuming the levels of good are 1, 2, 3, 4, ..., 12, and that the reference category was 1, I think the simplest test of the null hypothesis that all the slopes are equal would be
    Code:
    testparm price#i(2/12).good, equal
    If the levels of good are an irregular set of numbers and too large to conveniently enumerate:
    Code:
    levelsof good, local(goods)
    testparm price#i(`goods').good, equal

    Comment


    • #3
      I agree with the testparm but I am not sure about adding the -equal- option. It seems to me that this would allow good #1 to have a different slope than goods 2-12. Instead I think you want to test whether all the interactions are 0, which would be written as

      Code:
      testparm c.price#i.good
      I may be misunderstanding the problem but give it a try and see how it looks.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Ok, thank you both. I will give both a try. The dataset is large, so the regressions will take over a few hours.
        I am using Stata SE x64 ver 13.1 with Win 7 x64 and with 8 GB of ram.

        Comment


        • #5
          Why aren't you just using the probit command? I believe it is more efficient than glm when estimating the same model.

          If the dependent variable is a proportion and you were using Stata 14, you could use the fracreg command.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Re #4. No, don't do it both ways. Richard is right; I had misunderstood your original post, but on re-reading it I see that the use of the -equal- option would not be correct here.

            Comment

            Working...
            X