Announcement

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

  • xtlogit error (outcome does not vary)

    Hello,

    I ran a random-effects logistic regression model in Stata 16.1, but the following error occurred.
    Code:
    xtlogit st01 c.dhea_s_3cn i.wave, i(id) re
    . xtlogit st01 c.dhea_s_3cn, i(id) re
    outcome does not vary; remember:
    0 = negative outcome,
    all other nonmissing values = positive outcome
    r(2000);

    However, I checked the frequency of this variable in the data and did not find any missing values.
    Click image for larger version

Name:	1.png
Views:	1
Size:	10.5 KB
ID:	1682630


    Could anyone tell me how to solve this problem?

  • #2
    Maybe try
    Code:
    generate byte has_missing = missing(dhea_s_3cn, wave, id)
    tabulate st01 if !has_missing, missing

    Comment


    • #3
      Hi I am new to Stata and the Forum and I also encounter issue with xtlogit. Appreciate any help: I ran the xtlogit on panel data with interaction. Then I tried to run margins and marginsplot command. I got error message saying that, "invalid at() dimension information; using variable IMEA (moderating variable) as a factor variable and a regular variable is not supported". Anyone can help? Thanks

      Comment


      • #4
        JST:
        welcome to this forum.
        As per FAQ, please:
        1) show what you typed and what Stata gave you back;
        2) share an example/excerpt of your dataset via CODE delimiters.
        Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X