Announcement

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

  • Geometric least squares?

    Dear all,
    I have a question.
    I've got a geometrically distributed outcome (it's an antibody titer) and I want to test whether the geometric mean changes in three different groups of patients.

    I wonder whether a linear regression is appropriate (exponentiating the coefficients with eform) or if an estimation method based on "geometric least squares" is available.

    Thank you.
    Gianfranco

  • #2
    I'd use a generalised linear model here with log link here.

    Comment


    • #3
      To add to Nick’s suggestion: You can use Poisson regression with a log link (exponential mean) and it’s fully robust to misspecification of the distribution. Use robust standard errors. That’s an easy solution. More complicated but not too hard is to use an exponential mean and the geometric distribution, which, like the Poisson, is in the linear exponential family. So it’s also completely robust to distributional misspecification. Actually, since the geometric is a special case of neg binomial, you might be able to fix the appropriate parameter at unity and use glm.

      Comment


      • #4
        I think this does it:

        Code:
        glm y x1 ... xK, fam(nb) link(log) vce(robust)
        The default is to set the dispersion parameter to unity, which gives the geometric.

        Comment


        • #5
          Thank you so much to Nick and Jeff
          My data are distriubuted as follows:

          Click image for larger version

Name:	igg.png
Views:	0
Size:	0
ID:	1691992




          I have the following three geometric means:

          Group 0: 2583.70
          Group 1: 858.12
          Group 2: 1676.84


          I tried an unadjusted model. How do you interpret it? I think I should consider to report results as irr.

          Thank you again.
          I wonder whether a quantile model could be an option, to account for skeweness of data.

          glm IgGT3 i.group, fam(nb) link(log) vce(robust)

          Code:
          ------------------------------------------------------------------------------
                       |                 OIM
                 IgGT3 | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                 group |
                    1  |  -.7624329     .32741    -2.33   0.020    -1.404145   -.1207211
                    2  |  -.4044871   .2782252    -1.45   0.146    -.9497985    .1408242
                       |
                 _cons |    8.15122   .1890095    43.13   0.000     7.780768    8.521672
          ------------------------------------------------------------------------------
          Last edited by Gianfranco Di Gennaro; 04 Dec 2022, 08:18.

          Comment


          • #6
            Dear Jeff Wooldridge , since my right skewed outcome is not discrete isn't it better to use a gamma distribution?

            glm y x1 ... xK, fam(gamma) link(log) vce(robust)
            Thank you so much!

            Comment


            • #7
              The attachment in #5 is an empty file.

              Do you have any zeros in the data? Otherwise why not show us the data on log scale, as in these examples using qplot from the Stata Journal?

              Code:
              webuse grunfeld, clear
              
              set scheme s1color
              
              local opts ysc(log) yla(1000 300 100 30) aspect(1) xla(0 0.25 "0.25" 0.5 "0.5" 0.75 "0.75" 1)
              
              qplot invest if company <= 3 , over(company) `opts' legend(row(1)) name(QP1, replace) 
              
              qplot invest if company <= 3 , by(company, row(1) note("")) `opts' name(QP2, replace)
              (The code is a tidied up script after a few iterations around graph choices.)

              Click image for larger version

Name:	QP1.png
Views:	1
Size:	22.8 KB
ID:	1693429


              Click image for larger version

Name:	QP2.png
Views:	1
Size:	23.7 KB
ID:	1693430


              Clearly any other graph will be fine that shows each distribution in detail in a way that allows easy and effective comparison with the others. (Here, and elsewhere, box plots are typically not as helpful as more detailed views.)

              Here the quantile plots are propaganda for a view that log scale is natural for the variable in question, as leading to

              * approximately symmetric distributions

              * approximately equal variability

              * additive shifts between distributions


              We don't have to fuss about the relative importance of those, as we get all at once. But I think the last is most important given the kind of testing that is likely.

              Comment


              • #8
                Thank you Nick Cox.
                I will follow your advice.
                Here's below my original distribution



                I hope you can see it. I often have serious problems in attaching files in Statalist


                Attached Files
                Last edited by Gianfranco Di Gennaro; 14 Dec 2022, 04:23.

                Comment


                • #9
                  All those files are empty. What does work best are .png attachments. Not .gph. The forum software was not written by StataCorp and does not understand Stata file formats.

                  Can you post the data?

                  Comment


                  • #10


                    Thank you Nick Cox
                    This time it should work.
                    It's a continuous variable ranging from 0.02 to 2.63

                    I wonder whether to use a gamma distribution with link "power -1", or gamma with "log" link. In this latter case it's the same of a Poisson distribution, isn'it?
                    Addictional trouble, interpreting gamma regression coefficients is not easy in this case.
                    Thank so much for your time!
                    Gianfranco

                    Click image for larger version

Name:	graph2.png
Views:	1
Size:	42.2 KB
ID:	1693478

                    Comment

                    Working...
                    X