Announcement

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

  • Fixed effects for linear binomial regression

    Hello,

    I am running a linear binomial regression model, with survey weights. I am using GLM, example syntax below:

    Code:
     svy: glm y i.x1##i.x2 z, fam(bin) link(id)
    I want to include fixed effects for survey year and state of residence. Normally, I would use xtset, and then "fe" for fixed effects. I have not found a way of using "xt" with glm. So I tried this:

    Code:
     svy: glm y i.x1##i.x2 z i.year i.state, fam(bin) link(id)
    But the model does not converge. I am not sure if the xtset approach would make any difference with convergence. Is there a way to incorporate fixed effects with glm other than by putting them as variables directly into the model?

    By the way - the reason I am using the unusual linear binomial model is to estimate an additive interaction with a binary dependent variable. Otherwise I would just use logit or something similar.

    Thanks!
    Last edited by Robbie Dembo; 28 Aug 2024, 10:28.

  • #2
    I find your question very unclear but it appears you may want to use -meglm- rather than -glm- (and yes, -meglm- can be used with svy); see
    Code:
    h svy estimation

    Comment


    • #3
      xtset won't matter if you use i.state, and I don't think it matters with meglm either.

      Comment


      • #4
        Robbie:
        as an aside to previous helpful advice, the usual recipe to deal with a MLE that does not convege, is starting off with a more parsimonious specification, then adding one more predictor at a time and see when convergence issues creep up.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Robbie: I'm surprised you get convergence at all given that you're using a linear probability model and then using the Bernoulli log likelihood function. I'm intrigued because I've never seen this done in economics. The reason is that, as soon as any fitted value wants to go outside the (0,1) interval, the objective function isn't defined. In addition to causing general computational problems, the statistical properties of such estimators are not known (because the valid parameter space effectively depends on the data, which is not allowed with standard asymptotic inference).

          If you insist on a linear model, then just use OLS for estimation. There will be no convergence problems, of course, and it's easy to obtain valid standard errors for survey designs.

          With a generated data set I use for difference-in-differences, I was able to reproduce your problem: for some models the iterations converge, for others they don't. When they do converge, the estimates are close to OLS. So, again, this points to OLS using the svy: prefix.

          Comment


          • #6
            Sorry for the delay - thanks for the helpful responses and context.

            Comment


            • #7
              By the way, Jeff - I am following the approach on page 1663 of Richardson et al. (2015). "Standardized binomial models for risk or prevalence ratios and differences". Agree with you, though, about the fitted values outside of 0,1. Does an OLS model for a binary outcome have a specific name?

              Comment


              • #8
                Robbie:
                do you mean linear probability model?
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  I was using a model that Richardson refers to as a linear binomial model. But maybe that would work too? The idea is really just to get additive interaction estimates with a binary outcome.

                  Comment


                  • #10
                    This is a good example of where one should distinguish between a model and an estimation method. The model is linear in parameters and called, as Carlo said, the linear probability model. A separate question is how one estimates those parameters. In econometrics, OLS is by far most common. The MLE can lead to computational problems — as you discovered. If one is using a linear model, I think OLS is much preferred.

                    Comment

                    Working...
                    X