2

I would like to estimate a logistic regression model where the target variable $y_{it}$ is grouped. It is the number of experiments and the number of successes for a given unit $i$ during time period $t$. I would like to fit a fixed effects model and additional covariates $X_{it}$. This post presents the "within transformation" as a way to estimate OLS fixed effects models. In that case, the target $y_{it}$ is continuous and the OLS model is transformed as:

$$y_{it} - \bar y_i - \bar y_t + \bar y_{it} = (\bf x_{it} - \bar x_i - \bar x_t + \bar x_{it})\bf \beta$$

I don't see how this can be used in logistic regression since $y_{it}$ is not a single number but 2 related counts. Is there any way to approach this other than the dummy variable method?

badmax
  • 1,659
  • 7
  • 19
  • 2
    Could you please explain what you mean by the "within transformation"? – whuber Jan 04 '22 at 00:24
  • Updated with details. – badmax Jan 04 '22 at 00:37
  • 1
    Although the question was already answered to your satisfaction, out of curiosity: why don't you directly fit a logistic regression with the grouped data? This is a bit tricky in R (use proportions as response and the number of experiments in `weights`), but it is built into `glm`. – cdalitz Jan 04 '22 at 08:25
  • I have a model with group fixed effects and hundreds of other variables I want to regularize. I tried to fit it with `glmnet`, using a $0$ penalty for the fixed effects, but `glmnet` runs into numerical issues and doesn't converge. So I am looking at different approaches. – badmax Jan 05 '22 at 17:59

1 Answers1

4

The within transformation will not work because of the non-linearity of the logit function. There are some possible solutions:

  1. Fit a panel linear probability FE model
  2. Conditional logit
  3. Unconditional fixed effects logit estimator using dummies
  4. Pseudo-demeaning algorithm
  5. CRE (Mundlak-Chamberlain device)
dimitriy
  • 31,081
  • 5
  • 63
  • 138