Announcement

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

  • Model building in logistic regression and likelihood ratio tests

    Hi,
    I am using a forward stepwise logistic regression to build a model of independent predictors of my outcome variable. I am a little bit confused as to how I carry out the likelihood ratio tests after each variable I add to the model to decide whether I should keep it or not. I have the command lrtest but I am not sure if I am using it correctly. I am using the following command for the forward stepwise logistic model:
    xi: logistic outcomevar i.variable1

    Any help will be appreciated.

    Kind regards,

  • #2
    You should not do stepwise to begin with, see: http://www.stata.com/support/faqs/st...sion-problems/

    If you still want to do it, then just use the stepwise prefix, see help stepwise.

    Also you should no longer use the xi: prefix, just use factor variables instead, see help fvvarlist.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      I have to use forward stepwise logistic regression because it is the best way to achieve what I want to achieve. I have looked at the stepwise prefix and it is still confusing to me. What I really want to know is how to carry out likelihood ratio tests and if I have the right command "lrtest" to decide what variables to keep in or exclude.

      Comment


      • #4
        Has anybody got any useful suggestions for me? The stepwise prefix doesn't work for me and I get an error message of "factor variables and time-series operators are not allowed". I also want to know how to carry out likelihood ratio tests afterwards which would tell me which variables to include and exclude.

        Kind regards,

        Comment


        • #5
          Stepwise doesn't support factor variables so you either need to compute them yourself or use the otherwise horrible xi: prefix. If the categorical variable has more than 2 categories you may wish to force them to enter as a block. So something like

          webuse nhanes2f, clear
          xi: sw, pe(.05) lr: logit diabetes (i.race) weight

          Then see

          http://www.stata-journal.com/article...article=dm0032

          Which shows you how to take the results from stepwise and feed them into nestreg to get the results you want.

          I believe in letting people do what they want. But having said that, I would seriously consider Maarten's argument that stepwise is often/usually a bad idea.

          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment

          Working...
          X