Announcement

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

  • unexpected "variable b not found" when doing stepwise nbreg or poisson regression

    Hi Everyone,
    first time poster here as I usually find the answer somewhere here.

    I am running a stepwise nbreg model with number of hospital admissions as the outcome and a range of predictor variables.

    the command is:
    stepwise, pr(.05): nbreg admissions_total i.var01 i.var02 var03 var04 var05 var06 var07 var08 var09 var10 var11 var12 var13 if age_cat==1

    Stata starts the model and then gives me an error message "variable b not found"

    STATA output:

    note: 1b.var01 omitted because of estimability.
    note: 1b.var02 omitted because of estimability.

    Wald test, begin with full model:
    p = 0.9578 >= 0.0500, removing var03
    variable b not found
    r(111);

    Before I set varabbrev off, the error message was:
    "b ambiguous abbreviation
    r(111);"

    There is no variable b among my variables. Does anybody know what is happening and how to solve this issue?

    Thanks in advance!
    Last edited by Stef Krauth; 03 Nov 2022, 08:37. Reason: typo, missing tags

  • #2
    There are quite a number of critiques of stepwise estimation which you should be aware of, e.g., this, but I will stay away from that for now and deal with the problem at hand. Update your Stata installation.

    Code:
    update all
    This problem was fixed in the update on 15th Dec. 2020. See

    Code:
    h whatsnew
    -15dec2020-

    6. stepwise with variable abbreviation on, and when specified with a model where a variable was dropped because of estimability, incorrectly dropped any other variable that appeared to be an abbreviation of the dropped variable. This has been fixed.
    If you are unable to update your installation for one reason or the other, use the old -xi- prefix:

    Code:
    xi: stepwise, pr(.05): nbreg admissions_total i.var01 i.var02 var03 var04 var05 var06 var07 var08 var09 var10 var11 var12 var13 if age_cat==1
    Last edited by Andrew Musau; 03 Nov 2022, 09:27.

    Comment

    Working...
    X