Announcement

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

  • Forward stepwise logistic regression using NHANES 2009-2010 data

    Hello

    Can you you help please.

    I am trying to set up forward stepwise logistic regression (LR) using NHANES 2009-2010 data. My dependent variable is (Y) is anyohpv (Any oral hpv). I have 20 independent variables (X)

    I have reviewed the NHANES website but can't find any information on setting up forward stepwise LR model other than the the simple logistic regression which continues to add each independent variables (see below example). Is this method sufficient to use?

    Also I would like to use good-of-fit test but understand I cannot use Hosmer-Lemeshow due to survey sampling design. Can you please offer any help with command/s I could use after fitting the forward stepwise LR model please. Any help is greatly appreciated! Thank you Dianne

    Commands used in Stata for forward stepwise LR model

    xi: svy, vce(linearized): logistic anyohpv

    xi: svy, vce(linearized): logistic anyohpv i.gender2

    xi: svy, vce(linearized): logistic anyohpv i.gender2 i.ridreth1

    xi: svy, vce(linearized): logistic anyohpv i.gender2 i.ridreth1 i.education
    Many thanks and kind regards
    Dianne

  • #2
    First off, unless you are using an ancient version of stata, don't use xi. Just use factor variables. Type -help fvvarlist- or better yet read section 11.4.3 of the User Guide.

    To be clear, you don't want mindless stepwise selection, right, where the computer picks the variables for you? svy and sw don't get along. I would describe your approach as hierarchical.

    You could add commands like

    testparm i.education

    if you want to test whether the education dummies, as a block, are significant.

    Not everybody like Hosmer-Lemeshow anyway so not being able to do it may be no great loss: http://www.statisticalhorizons.com/hosmer-lemeshow

    Do you really need all these intermediate models? If you want to, say, see how the effect of gender changes as you add more variables, there are potential problems with doing that in logistic regression. See http://www3.nd.edu/~rwilliam/xsoc73994/Nested02.pdf
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

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

    Comment


    • #3
      Thank you so much Richard for all your help! Kind regards Dianne
      Many thanks and kind regards
      Dianne

      Comment


      • #4
        Hello again Richard, I have used below command but receive error message option table not allowed

        estat gof, group(8) table

        I'm not sure how to sort this as I would like table.

        Any help would be greatly appreciated thanks! Dianne
        Many thanks and kind regards
        Dianne

        Comment


        • #5
          http://www.stata.com/manuals13/restatgof.pdf. It says estat gof is not appropriate with the svy prefix. If you were using svy then the error message is not as clear as it could have been.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

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

          Comment


          • #6
            That is a documentation oversight on our part.

            We'll need to update that manual entry to point to a corresponding entry in the
            SVY manual instead.

            If you type

            Code:
            help estat gof
            in Stata you should be directed to a table of choices. The one Richard references is
            for estat gof after logistic which was not designed to be used with svy
            estimation results. The one Dianne is using is documented in the SVY manual.

            In Stata type

            Code:
            help svy estat
            and search for estat gof. This estat gof available after svy does not
            support the table option, the test statistic is computed differently that in the
            non-survey situation.

            Comment


            • #7
              Thank you very much Jeff for your help! Kind regards Dianne
              Many thanks and kind regards
              Dianne

              Comment

              Working...
              X