Announcement

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

  • How I find the wrong data?

    Dear Statalist,
    I have the note: multiple positive outcomes within groups encountered, followed by
    clogit Y asc fish_d2 fish_d3 vet_d2 vet_d3 alc_d2 alc_d3 smk_d2 smk_d3 pqt_d2 pqt_d3, group (ncs) cluster(
    > ID). Help me to find the ID that has multiple positive outcomes.
    Best Wishes,
    Sukunta



  • #2
    Code:
    gen byte touse = !missing(Y, asc, fish_d2, fish_d3, vet_d2, vet_d3, alc_d2, alc_d3, smk_d2, smk_d3, pqt_d2, pqt_d3, ncs, ID)
    bysort ID touse : gen ny = sum(Y) if touse == 1
    bysort ID touse : gen ny = ny[_N] if touse == 1
    list ID Y ny if ny>1, sepby(ID)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Just a quick note to say that "multiple positive outcomes" may or may not signify "wrong data" to begin with. In some disciplines, clogit is used for matched case-control designs with 1:1 or 1:k case-control matching (cases being observations with y = 1, control being y = 0). If this is your setup, then yes this warning signifies "wrong data". In many economics applications on the other hand, clogit is a way to run logit with fixed effects, with the groups having one or more successes (y = 1) and one or more failures (y = 0). If this is your setup, you can just ignore the warning.

      Comment


      • #4
        Dear Buis,
        Thank you so much, however it has 1,044,302 obs. I found it by my manual (accident) ^___^. The Y is all 0 in one group. Thus,I run it again, the note is not show now.
        Best Wishes,
        Sukunta
        Dear Kumar,
        Thank you so much, let me tell you that I used clogit for discrete choice experiment then the note of my model should not show.
        Best Wishes,
        Sukunta

        Comment

        Working...
        X