Announcement

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

  • Test with dummies: if dummy 1, Y is usually bigger.

    Hi everybody.

    I want to know, if there is a test in Stata, when I want to test for example:

    If dummy 1, then Y is bigger. If dummy is 0, then Y is more often smaller.

    The thing is that I work with panel data. So I have "Y" data over 14 years and every year contains around 30 variables of "Y". So the test should somehow just check the dummies for the same year.

    In other words: I have 30 NBA teams for over 14 seasons. For every NBA I have a gini coefficient. I want to check if the dummy is 1, is the gini coefficient going to be bigger or smaller in average compared in the same season. So the test should check for every season.

    Is there such a test? what would be the comand?

    I hope for fast help. I have not much time. Thank you very much.
    Last edited by Stan Breetman; 09 Aug 2017, 02:36.

  • #2
    reg Y dummy

    Comment


    • #3
      Originally posted by Jesse Wursten View Post
      reg Y dummy
      Thank you Mr. Wursten

      Are you sure reg checks Y just for the same season? Maybe I should use xtreg because of paneldata? Because I want check for all 14 seasons..
      Last edited by Stan Breetman; 09 Aug 2017, 03:22.

      Comment


      • #4
        You should add season dummies then (i.season) or use xtreg Y dummy, fe after you have xtset your data.

        Comment


        • #5
          Or you could do a regression for each year, although 30 observations a year can be a bit tight to do inference. Consider
          Code:
          clear all
          set more off
          sysuse auto
          
          gen w = weight > 3000
          forval i = 0/1 {
              di "Regression for foreign = `i'"
              regress price w if foreign == `i'
              di ""
          }
          This is just an example. In your case you would have i = 1/14 because those are the years. and then you would condition with if year == `i'. You would get 14 regressions, one for each year and for each year you would be doing a test of the means depending on the category of the dummy.
          Alfonso Sanchez-Penalver

          Comment

          Working...
          X