Announcement

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

  • Using CMP for Generalized Linear Models

    Hello Mr. @DavidRoodman, Is it possible to use the cmp command to estimate a generalized linear model with log-link and a gamma function? Thanks Marcos Silveira

  • #2
    Is there a reason you don't want to, or can't, use the glm command?

    Comment


    • #3
      Thanks Mr. Wooldridge. I'm trying to estimate the effects of health insurance and other characteristics on the household's healthcare expenditures in a model with two features: heterocedasticity and endogenous treatment (having or not health insurance). On a hand, the "glm" allows me to deal with heterocedasticity (but not endogenous treatment I think). On the other hand, I know the commands "etregress" and "cmp" allow me to deal with endogenous treatment. My idea was to use cmp in order to estimate a gamma function (and log-link) with endogenous treatment. Is it possible? Is there any other way to deal with the two features above in the same model? Thanks

      Comment


      • #4
        Originally posted by Marcos Silveira View Post
        Is it possible to use the cmp command to estimate a generalized linear model with log-link and a gamma function?
        Looking at its help file (net describe cmp, from(http://fmwww.bc.edu/RePEc/bocode/c)), it doesn't appear to include that distribution-link function combination among its generalized linear modeling capabilities.

        Originally posted by Marcos Silveira View Post
        My idea was to use cmp in order to estimate a gamma function (and log-link) with endogenous treatment. Is it possible? Is there any other way to deal with the two features above in the same model?
        Take a look at the official Stata command gsem (help file here. It can handle endogenous predictors, I believe, through its path analysis capabilities, and according to the family-link function table here, it can fit generalized linear models with gamma distribution and (default) log link function.

        Comment


        • #5
          I see. CMP should be able to handle that. Is the household expenditure sometimes equal to zero, which is why you don't want to take the log? If you can use log(expenditure) then I can point you to a recent paper that allows heteroskedasticity, heterogenous slopes, and endogenous treatment.

          Comment


          • #6
            Originally posted by Joseph Coveney View Post
            Looking at its help file (net describe cmp, from(http://fmwww.bc.edu/RePEc/bocode/c)), it doesn't appear to include that distribution-link function combination among its generalized linear modeling capabilities.

            Take a look at the official Stata command gsem (help file here. It can handle endogenous predictors, I believe, through its path analysis capabilities, and according to the family-link function table here, it can fit generalized linear models with gamma distribution and (default) log link function.
            Thanks Mr. Coveney. I'll try this command.

            Comment


            • #7
              Originally posted by Jeff Wooldridge View Post
              I see. CMP should be able to handle that. Is the household expenditure sometimes equal to zero, which is why you don't want to take the log? If you can use log(expenditure) then I can point you to a recent paper that allows heteroskedasticity, heterogenous slopes, and endogenous treatment.
              Yes, I use log(expenditure) in the second part of a two-part model. I would be grateful if you could point me to this recent paper. Thanks Mr Wooldridge.

              Comment


              • #8
                Here is a link to the paper: Joshi and Wooldridge (2025)

                The way I would implement is the following. (1) Estimate a standard heteroskedasticity probit for the binary treatment. (2) Run the regression in (3.3) using linear functions in z(i) for the f(.) functions. This means the h^(i) appear by themselves, interacted with each exogenous variable (regressors and IVs), the treatment, and then triple interactions w(i)*h^(i)*z(i). I would strongly recommend bootstrapping the two steps, as we do in our empirical application (which shows it can make a pretty big difference).

                Comment


                • #9
                  Originally posted by Jeff Wooldridge View Post
                  Here is a link to the paper: Joshi and Wooldridge (2025)

                  The way I would implement is the following. (1) Estimate a standard heteroskedasticity probit for the binary treatment. (2) Run the regression in (3.3) using linear functions in z(i) for the f(.) functions. This means the h^(i) appear by themselves, interacted with each exogenous variable (regressors and IVs), the treatment, and then triple interactions w(i)*h^(i)*z(i). I would strongly recommend bootstrapping the two steps, as we do in our empirical application (which shows it can make a pretty big difference).
                  Thank you, Mr. Wooldridge. I'll try this model. I appreciate your help.

                  Comment

                  Working...
                  X