Announcement

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

  • logistic regression

    Trying to figure out why when I run a logistic regression test the response is r2000 or "no observations". Am I entering the command incorrectly or have I messed up my groupings earlier?

    logistic ari i.region

    multiple regression:
    logistic PCV1totals i.windex5 i.melevel i.HL4 i.region i.HH6

  • #2
    What do you see if you run the following commands?

    Code:
    summarize ari if !missing(region)
    summarize PCV1totals if !missing(windex5, melevel, HL4, region, HH6)
    --
    Bruce Weaver
    Email: [email protected]
    Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
    Version: Stata/MP 18.0 (Windows)

    Comment


    • #3

      . summarize ari if !missing(region)

      Variable | Obs Mean Std. Dev. Min Max
      -------------+---------------------------------------------------------
      ari | 7,808 1.877561 .9925397 1 3

      . summarize PCV1totals if !missing(windex5, melevel, HL4, region, HH6)

      Variable | Obs Mean Std. Dev. Min Max
      -------------+---------------------------------------------------------
      PCV1totals | 19,270 .3473793 .4761499 0

      Comment


      • #4
        Ari is a binary yes/no answer

        i.HH6 i.region i.HL4 i.melevel i.windex5 - these are sex, mothers education, wealth and region

        So the above doesn't make sense to me

        Comment


        • #5
          Originally posted by justine gosling View Post
          Ari is a binary yes/no answer
          Then why has it values 1 to 3? For logit or logistic, Stata wants binary/boolean, that is, 0 or 1 coding. More specifically, Stata distinguishes between false (0) and true (any other value, often including missing values). Estimation commands, such as logit and logistic will understand that missing values (., .a, ..., .z) are not to be interpreted as true but as missing.

          However, you should have received the following notification

          Code:
          outcome does not vary; remember:
                                            0 = negative outcome,
                  all other nonmissing values = positive outcome
          r(2000);
          which provides the explanation that I have given.

          btw. note how Bruce and I are using CODE delimiters to show Stata code and output; so should you.

          Best
          Daniel

          Comment

          Working...
          X