Announcement

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

  • Name conflict error after collapse

    Hi everyone:

    When I run this command:

    Code:
            collapse (mean) idhh_11 idorighh ///
                            optionI ///
                            choiceI ///
                            choice ///
                            hI LI ///                
                            ardens arintr arthin  ///
                            hsize purehh dwt* Nflexindi* ///
                            Nchild18 Nadult18 Nchild25 ///                    
                     (sum)  ConsumPB1-ConsumPB50 ///
                            grossincPB1 grossincPM1 grossincPF1  ///
                            nettaxPB1 nettaxPM1 nettaxPF1 ///
                            yempI ///
                            ygro* yemptot* ysemtot* ycontot* ymot* yprotot* ycaptot* ypentot* nept* ydis* sic* tax* ben* ///
                            wageAC wagePM1 wagePF1 sme smn sfe sfn ///
                            ageI agesqI lnageI lnagesqI ///
                            decmakIM decmakIF decmakI ///
                            nch00I nch01I nch02I nch03I nch04I nch05I nch06I nch07I nch08I nch09I /// 
                            nch10I nch11I nch12I nch13I nch14I nch15I nch16I nch17I nch18I        ///                     
                            edyearI  edyrsqI ///
                            hslima1I hslima2I wexpI wexpsqI  ///                    
                            peak* flexindi* drgurI drgmdI educLI educMI educHI incothmem educNoI educPriI educSecLI educSecHI educUniI citiI /// 
                            age38_10 age38sq_100 /// 
                     , by(idhh)
    I get the following error message:

    Code:
    error:
           ygroPB1 = (sum) ygroPB1
           ygroPB1 = (sum) ygroPB1
    name conflict
    r(198);
    I must say here that for the variables ygro* yemptot* ysemtot* ycontot* ymot* yprotot* ycaptot* ypentot* nept* ydis* sic* tax* ben* the rest of the name is PB1 to PB50 (for each of them).

    When I remove ygro* from the varlist, the same error message appears but for the variable yemptot*. And the same goes all the way to ben*.

    Moreover, when I remove all these variables (ygro* yemptot* ysemtot* ycontot* ymot* yprotot* ycaptot* ypentot* nept* ydis* sic* tax* ben*), the error message now appears for the variable grossincPB1, and when I remove this variable, the last variable causing the error is nettaxPB1. Once I remove the latter, the command runs well.

    Does anyone have a clue what is going on - I'm very confused, especially with the fact that grossincPB1 and nettaxPB1 cause a problem ONLY after I remove ygro* yemptot* ysemtot* ycontot* ymot* yprotot* ycaptot* ypentot* nept* ydis* sic* tax* ben*.

    (Sorry for this possibly messy description of my issue but I don't know how to describe it in a different way. I hope it's clear enough.)

    Thank you for your time.

    Best,
    Ivica
    // ivica_rubil //

  • #2
    You don't think you're asking for the same summary twice, but Stata thinks you are. The explanation I guess at is that the range

    Code:
      
     ConsumPB1-ConsumPB50
    includes more variables than you think it does, as you should check with
    Code:
      
     d ConsumPB1-ConsumPB50
    That is, you may want to refer to ConsumPB* at that point.

    Comment


    • #3
      Thank you, Nick; your guess was right. I should avoid the slippery slope of using ranges in varlists.
      // ivica_rubil //

      Comment

      Working...
      X