Announcement

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

  • Repost: Why are my variables being omitted by Stata?

    Im reposting whit data example:

    'm doing a random effects model. I have a dummy per treatment, which would be "Message", "MessageTax", "Tax" and "Donation" which refers to whether or not the experiment included a donation. The data comes from 2 similar experiments, but one was with a donation and the other was not, so the Message, Tax and MessageTax treatments are in both experiments. This appears in Stata when I run this regression:

    xtreg q Mensaje MensajeImpuesto Impuesto Donacion Donacion##Mensaje Donacion##MensajeImpuesto Donacion##Impuesto,re

    How can I fix it?




    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(Mensaje Impuesto MensajeImpuesto) float Donacion
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 1 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 0 0 1
    0 1 0 1
    0 1 0 1
    0 1 0 1
    0 1 0 1
    0 1 0 1
    end


  • #2
    Oye, how come you're including the first 4 independent variables AND their interaction terms ##? This has the effect of including the variables twice in the regression, meaning it has to drop out since it is perfectly collinear

    Comment


    • #3
      Jared: The intention is to estimate the effect of the different treatments: Base, Message only, Tax only and Tax&message in the experiment without donation and in the experiment with donation, that is why there are the variables alone and their interactions.

      Comment


      • #4
        that is why there are the variables alone and their interactions
        Yes, but the ## operator is not just the interaction. When you write A##B, that is interpreted by Stata as A, and B, and their interaction. So if your write A B A##B, then A and B occur twice and Stata will omit one of the duplicates. Similarly, when you include a homebrew interaction variable that replicates an interaction term created by # or ## with the same variables, it is a duplicate and will have to be removed. The model you want can and should be coded as
        Code:
        xtreg q i.Mensaje##i.Impuesto##i.Donacion, re

        Comment


        • #5
          I understand. Thank you very much for your help!

          Comment


          • #6
            Could you tell me what the 1 1 in the output mean? thank you

            Comment


            • #7
              In the general situation, you can have an interaction between categorical variables that have more than just two levels. For example you might have a 5 category variable for nationality and a 6 category variable for religion. Then the interaction of those would consist of (5-1)*(6-1) = 20 variables. The variable corresponding to, for example, nationality = 4 & religion = 2 would show up in the output as 4 2 under the nationality#religion heading.

              In your case, the variables being interacted are just 0/1 variables. So there is only one level in the interaction, and its labeling is 1 1.

              Comment


              • #8
                A little more precisely, the 1 1 reflects the fact that there are no value labels assigned to these values of the variable. I believe if they have value labels, Stata will be default show these.

                Comment

                Working...
                X