Announcement

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

  • Estimating A Predicted Probability for A Sub-Population of a Survey

    Hi, All:

    I would like to estimate a predicted probability for my sub-population in my survey. I have already used my svyset specifications (e.g. strata, cluster, psu) using the design weights of the 2016 National Health Interview Survey.

    How would I do this?

    I have ran this logistic regression.

    svy, subpop (hispanicorigin): logistic mammogramadherent born

    However, I want to know how to estimate the predicted probability of the variable "born". (Sorry, for not using the dataex command. I'm not sure how to use it with sub-population commands.)

  • #2
    Do you mean mammogramadherent? born is an independent variable so you wouldn't predict its probability.

    My guess is you want

    predict hispanicprob if hispanicborn
    -------------------------------------------
    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
      Yes, I meant mammogramadherent. What would be the correct syntax for that?

      I am bit confused by the predict syntax you shared. I am not sure if hispanicprob and hispanicborn are generated variables.

      Comment


      • #4

        I should have said

        Code:
        predict hispanicprob if hispanicorigin
        hispanicprob will be a generated variable. It will be generated for those who are nonzero and nonmissing on hispanicorigin and will be missing for everyone else,
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

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

        Comment


        • #5
          You can do Richard's comment more verbosely
          predict yhat if born==2

          This predicts using the sample values restricting the predictions to observations where born is 2. Is this what you want? Depending on your purpose, margins will also do predicted values.

          Comment


          • #6
            Yes, Phil. Thanks.

            Comment

            Working...
            X