Announcement

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

  • How to estimate the standard error of the probabilities that include the rnadom effects in meqrlogit

    Hello

    I would like to create a graph of predicted probabilities including both fixed and random effects plus 95%CI, similar to that at the following link (no 95% CI here):
    https://stats.idre.ucla.edu/stata/fa...-in-xtmelogit/

    I used the –meqrlogit- instead of –xtmelogit-. The 3-level null model (no independent variable) is:

    .meqrlogit binaryoutcome || region: || hospital:

    //// predicted probability for hospital
    .predict re_hosp, reffects relevel(hospital) // linear predictor for the random effects
    .predict fe_hosp, xb // linear predictor for the fixed effects
    .gen pred_prob_hosp = 1/(1+exp(-1*(re_hosp+fe_hosp))) // compute probabilities using both fixed and random components for hospital

    //// standard errors
    .predict re_se_hosp, reses relevel(hosptial)
    .predict fe_se_hosp, stdp

    My questions are:
    1. Does predict fe_se_hosp, stdp give the correct fixed standard error?
    2. How to combine the re_se_hosp and fe_se_hosp?
    .
    Thank you,

    Lei

  • #2
    Question 1: yes.

    Question 2. One of the assumptions of the model underlying -meqrlogit- (or -melogit- or -xtlogit, re-) is that the random effects are independent of the predictors and the bottom level residuals. So you can combine them as

    Code:
    gen se_overall = sqrt(fe_se_hosp^2 + re_se_hosp^2)

    Comment


    • #3
      Thank you so much! So, Is it right to compute the std err for the probability like this:
      gen se_overall_prob=pred_prob_hosp*(1-pred_prob_hosp)*se_overall

      Comment


      • #4
        I honestly don't know. se_overall gives you the standard error of the mixed-effects predictor. To then pull back to the probability means applying the inverse logistic transformation, so the standard error would be calculated by the delta method. I remember from a long time ago that when you do that you end up with something fairly simple, and it may indeed be the formula you show, but I'm not certain. Perhaps somebody else does.

        Comment


        • #5
          Regarding my post above, I used "predict fe_hosp, xb" for the fixed effect for hospital, but this actually is for the subject level. How can I specify the hospital-level, similar to felevel(hospital)? Thanks for your help!

          Comment


          • #6
            There is no analogous specification to -predict-. Just take the xb prediction and add to it the predicted value for the hospital level random intercept.

            Comment


            • #7
              I really appreciate your thoughts and suggestions, Dr. Schechter!

              Comment

              Working...
              X