Announcement

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

  • #31
    Originally posted by Clyde Schechter View Post
    Yes, this looks fine.

    You can graph these residuals, but I think it is hard to see what is going on when you do that. Unlike the residual plots that are sometimes done after linear regression, the residuals of a negative binomial regression are not going to be patterned in a way that is visually comprehensible. If you want to graph something, I would just plot the predicted values vs the observed values. The -predict- command will give you the predictive values. And then -graph twoway scatter- will produce the graphs. Nothing fancy or special needed here. The purpose here is not to "test assumptions" or anything like that--it's just to get a general impression of how the model looks compared with the observed values.
    That makes sense. Can you share code(s) for predicted values vs the observed value scatter plot?

    Comment


    • #32
      Code:
      glm ...
      predict predicted, mu
      graph twoway scatter mu observed
      Add whatever options you like to the -graph twoway scatter- command to adjust its appearance to your taste.
      I'm wondering why you asked for help with this--it's less complicated than the graphs you've already created on your own.

      Comment


      • #33
        Originally posted by Clyde Schechter View Post
        Code:
        glm ...
        predict predicted, mu
        graph twoway scatter mu observed
        Add whatever options you like to the -graph twoway scatter- command to adjust its appearance to your taste.
        I'm wondering why you asked for help with this--it's less complicated than the graphs you've already created on your own.
        Actually, I was unaware of how to incorporate observed in this graph. After running GLM, i use below commands and get error.

        Code:
        . predict predicted, mu
        
        . graph twoway scatter mu observed
        variable mu not found
        r(111);
        
        . graph twoway scatter predicted observed
        variable observed not found
        r(111);
        What possibly I am doing wrong?

        Comment


        • #34
          OK, -graph twoway scatter mu observed- was my error. It should have been -graph twoway scatter predicted outcome-, as the -predict- command will create a variable predicted, and you already have a variable outcome, which is the observed value.

          Comment


          • #35
            Originally posted by Clyde Schechter View Post
            OK, -graph twoway scatter mu observed- was my error. It should have been -graph twoway scatter predicted outcome-, as the -predict- command will create a variable predicted, and you already have a variable outcome, which is the observed value.
            Thank you so very much. I have played with this and below commands I used to generate Figure 1.

            Code:
             graph twoway (scatter predicted outcome) (lfit predicted outcome)
            Click image for larger version

Name:	scatter-predicted-observed.png
Views:	1
Size:	314.1 KB
ID:	1653084





            Also, I used below command to compare predicted vs. observed in time series to generate below figure 2.

            Code:
            tsgraph predicted outcome
            Click image for larger version

Name:	tsgraph-predicted-outcome.png
Views:	1
Size:	369.6 KB
ID:	1653085



            Last edited by Waseem Shaukat; 04 Mar 2022, 19:26.

            Comment


            • #36
              So the last question, I really hope this is last one :-):

              - What is the best to report from this model. IRR with 95% CI and p-value, or it should also be accompanied with co-efficient alone or coefficient with 95% CI, and/or HAC Standard Error (and whether SE of coefficient or SE of IRR)?

              Thanks.

              Comment


              • #37
                I would report the IRR with the 95% CI. I don't believe in using p-values for this kind of situation, but many people would report that, too. The coefficients are log-transforms of the incidence rate ratio, and I think they are harder for most people to understand. So I would not show the coefficients. Similarly, the standard errors are something that most people have difficulty understanding, so I would not show them either. The goal is to communicate things as understandably as possible. In my view the combination of the IRR and the 95% CI do that best.

                Comment


                • #38
                  Originally posted by Clyde Schechter View Post
                  I would report the IRR with the 95% CI. I don't believe in using p-values for this kind of situation, but many people would report that, too. The coefficients are log-transforms of the incidence rate ratio, and I think they are harder for most people to understand. So I would not show the coefficients. Similarly, the standard errors are something that most people have difficulty understanding, so I would not show them either. The goal is to communicate things as understandably as possible. In my view the combination of the IRR and the 95% CI do that best.
                  That makes sense. Thank you.

                  Please help me write the equation with Beta terms to report. Here is the final GLM model.

                  Code:
                  glm outcome predictor i.month, family(nbinomial 1) link(log) vce(hac nwest)
                  Last edited by Waseem Shaukat; 04 Mar 2022, 23:26.

                  Comment


                  • #39
                    The left hand side is ln E(Outcome). For ease of reading I would call the coefficient of Predictor BPredictor + summation from 1 to 12 of IMonth i. (where I would use the great upper case sigma notation for the summation).

                    I do not know how to get those symbols to show in this Forum editor.



                    Last edited by Clyde Schechter; 04 Mar 2022, 23:21.

                    Comment


                    • #40
                      Originally posted by Clyde Schechter View Post
                      The left hand side is ln E(Outcome). The whole thing looks like

                      [IMG]file:///C:/Users/clyde/AppData/Local/Temp/msohtmlclip1/01/clip_image002.png[/IMG]
                      perhaps, the image uploaded in not visible.

                      Comment


                      • #41
                        So I noticed. I've re-edited it as best I can (which is not good).

                        Comment


                        • #42
                          Originally posted by Clyde Schechter View Post
                          The left hand side is ln E(Outcome). For ease of reading I would call the coefficient of Predictor BPredictor + summation from 1 to 12 of IMonth i. (where I would use the great upper case sigma notation for the summation).

                          I do not know how to get those symbols to show in this Forum editor.


                          Do you mind sending across the image via email ([email protected]) if possible. I dont want to see an error in the equation, so having your written equation would help me understand correctly. Thanks

                          Comment

                          Working...
                          X