Announcement

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

  • #31
    Sohie:
    I agree with you: no squared term for age is necessary.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #32
      Thank you very much!

      Comment


      • #33
        Dear Statalist,

        I am working with three rounds or waves of MICS unicef data. It is a cross sectional dataset and I would like to use survey round fixed effects. I have generated a wave variable to identify each of the three waves/rounds.

        gen wave=1 if year <=2000
        gen wave=2 if year <=2006
        gen wave=2 if year <=2014
        Basically, these codes are created a count of the total for each round/wave.

        However, when I ran the regression
        reg Wazs i.year i.month i.wave, robust cluster (hv001)
        , the wave fixed effects are all omitted due to collinearity.

        Thank you for your reply,

        Kind Regards!

        Comment


        • #34
          gen wave=1 if year <=2000
          gen wave=2 if year <=2006
          gen wave=2 if year <=2014
          Not sure what you are doing here. The second command overwrites the first and the third overwrites the second. But Stata will not allow you to create two or more variables with the same name in the first place, so this cannot be the actual code that you ran. If the last year in the sample is 2014, your last command creates a variable equal to 1 for all observations. This will be collinear with the constant term in the regression.

          Comment


          • #35
            Dear Andrew,

            Thanks. I have created these in the given round. However, I see what you mean with all observations being equal. Do you have any suggestion on how this can me done?
            Thank you.

            Regards!

            Comment


            • #36
              Code:
              gen wave= cond(year <=2000, 1, cond(inrange(year, 2001, 2006), 2, 3))

              Comment


              • #37
                Dear Andrew,

                Thanks for the code. However, I got the same results as with the codes I used before, i.e., omitted due to collinearity. Please, do you have any other suggestions?

                Thanks.

                Regards!

                Comment


                • #38
                  reg Wazs i.year i.month i.wave, robust cluster (hv001)
                  You have to choose between month, year and wave dummies. You can not have more than one of the three as these are collinear. In short, by including month effects, you have accounted for year effects and wave effects as months are nested in years which in turn are nested in waves.

                  Comment


                  • #39
                    Dear Andrew,

                    Thanks so much. It worked.

                    I have one more question. I have a total of 5600 observations for children who were able to get vaccinated (5000 yes, 600 no), however when generating the dummy for vaccines, it is capturing missing values for the entire dataset. I have a total of 7000 Wazs observations, as such the dummy is assuming 2000 no (i.e the 600 and the 1400 missing observations) . Is there a way to generate the dummy to only take into consideration the 5600 vaccinated observations.

                    gen Vacc =1 if Immu==1
                    replace Vacc=0 if mi(Vacc)
                    Thanks for your help. I realised this is not a message for this topic. However, I am grateful for your help with this.

                    Kind Regards!

                    Comment


                    • #40
                      Hard to say without a data example. However, if you simply want a 1/0/missing variable

                      Code:
                      gen Vacc = cond(Immu==1, 1, 0) if !missing(Immu)| !missing(Wazs)
                      If this does not work, provide a data example using dataex.

                      Comment


                      • #41
                        Dear Andrew,

                        Thank you very much for your reply.

                        Regards!

                        Comment

                        Working...
                        X