I have the following Model and would like to know how to acquire the OLS-estimates when the model is expressed like this? I have tried to look it up, but no one is explicit about how to acquire the OLS estimates when you have a linear coefficient and the rest a non-linear expression. I know that if there was no 1 in the denominator, I would be able to take the logarithm of y, which would make the model linear in parameters, but the 1 is kinda irritating me at this point.

If I take logs, I get the following: $$ \log(y) = -\log(1+\beta_0 + \beta_1 x + u) $$ and this does not help me a lot because the the model is not linear in parameters.

Any help would be much appreciated

enter image description here

  • 2
    $\begingroup$ Welcome! How about $1/y = 1+\exp(\beta_0+\beta_1+u)$ so $\log(1/y-1) = \beta_0+\beta_1 x+u$? It is required that $0<y<1$. $\endgroup$
    – chan1142
    Jun 11, 2023 at 1:01
  • $\begingroup$ You can try least-squares. $\endgroup$ Jun 11, 2023 at 7:08

1 Answer 1


You can't estimate a model like this by OLS because it is not linear in parameters.

Are you willing to model this as shown below? $$y_i =\frac{1}{1+e^{\beta_0+\beta_1x_i}}+u_i $$

If so you could use nonlinear least squares. This can be implemented in Stata with the nl command.

If you are not able to change the modeling assumption, then I think you'd have to do method of moments. One moment would presumably be $E[u]=0$. The other moment would presumably be $E[xu]=0$. You'd have to code this yourself in python or matlab I think. You'd solve for the $\hat{\beta_0}$ and $\hat{\beta_1}$ such that the sample average of $\hat{u}$ is 0 and the sample average of $x_i\hat{u_i}$ is 0.

EDIT: You can do the method of moments in Stata. By solving for $u$, it is the case that $$u_i =\ln\left(\frac{1-y_i}{y_i} -\beta_0-\beta_1x_i\right)$$

Thus, the Stata code to do method of moments based on $E[u]=0$ and $E[xu]=0$ is

gmm (ln((1-y)/y) -{b0} -{b1}*x ), instruments(x)

You'll just need to change the names of $x$ and $y$ based on what they are called in your data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.