Announcement

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

  • 'Ambiguous abbreviation' error - var not ambiguous nor abbreviated

    I have been running some binary logit regressions then using margins for fitted probabilities, and suddenly started getting an error message for one variable, 'sex'.
    sex ambiguous abbreviation
    r(111);

    There are no similarly named variables.
    I renamed it as 'gender' and got the same error message for that variable.
    Updated software, same problem.
    Checked statalist and tried the following:
    . set varabbrev off, perm
    Tried again, same problem.

    This is a nice clean binary variable from a national survey dataset, and there were no problems with it previously during analysis.

    Here is my code and the error message:

    . quietly: logit unemp i.birtheth3 i.ageband20 i.recent10 i.degree sex i.sex#i.birtheth3 i.degree#i.birtheth3

    . margins birtheth3, at(degree=1 sex=1)

    sex ambiguous abbreviation
    r(111);

    Hope someone has some advice.

  • #2
    I think your problem is that you declare a main effect for sex and then use sex as a factor variable in the interaction with birtheth3. Margins gets confused. Do this as:
    Code:
    logit unemp i.sex##i.birtheth3 i.ageband20 i.recent10 i.degree  i.degree#i.birtheth3
    and you should be ok.
    Richard T. Campbell
    Emeritus Professor of Biostatistics and Sociology
    University of Illinois at Chicago

    Comment


    • #3
      Zora,

      Alternatively, you need to specify which level of the factor variables you want to use in the margins command. For example,

      Code:
      logit unemp i.birtheth3 i.ageband20 i.recent10 i.degree sex i.sex#i.birtheth3 i.degree#i.birtheth3
      margins birtheth3, at(1.degree 1.sex)
      "sex" is considered an "ambiguous abbreviation" in this context because it has multiple levels and you need to say which one you are interested in.

      Regards.
      Joe

      Comment


      • #4
        An orthogonal comment is that indicator (don't say "dummy") variables should be named for the category coded 1, say "female".

        War stories from seminars:

        "gender is a dummy variable."
        "But which way round is it?"
        "Oh, I forget."


        "gender is just a dummy variable" (before an audience of qualitative and quantitative types)
        <explosion from the qualitative types with accusations of not taking gender issues seriously enough>

        Comment


        • #5
          Gender is a social construct! Thanks for your help, this seemed to work. Sorry for the accidental multiple-post. Statalist rules.

          Comment

          Working...
          X