<p>Here's a more basic issue with the meaning of the analysis.</p>
<p>You say the demand curve came from regression, but you don't say whether you got the supply curve the same way.</p>
<p>You should be clear about what your observations represent. What was different about the observations and calculations used to estimate demand versus those used to estimate supply? Why was the price changing at all? E.g., was the seller deliberately adjusting the price as an experiment?</p>
<p>If all observations were of a price and quantity in equilibrium, then the observations would systematically vary only due to <em>changes</em> in one curve or the other. If only the supply curve changed, then the observations could estimate the stable demand curve; and vice versa. If both curves changed, then the observations follow neither a supply curve nor a demand curve.</p>

CC BY-SA 4.0
2020-09-10T05:14:18.117Z
2020-09-10T05:14:18.117Z
nanoman
<p>The approach you use has various problems.</p>
<ol>
<li>Yes you need more than 16 observations. In most parametric models (including OLS) as a rule of thumb you need at least 25-30 observations per independent regressor (see Newbold et al statistics for business and economics for example).</li>
<li>You can use a linear model but you should not assume demand is a linear function of price. OLS is a model that is linear in its parameters but that does not mean necessarily that the relationship between two variables should be modeled in a linear way.</li>
</ol>
<p>For example, a more realistic assumption about demand would be given by the following function:</p>
<p><span class="math-container">$$q = a p^{\beta_1} x^{\beta_2}$$</span></p>
<p>where, <span class="math-container">$q$</span> is quantity, and <span class="math-container">$x$</span> some control variable, which is not linear but after taking logs of both sides this demand can be modeled by OLS because OLS needs to be just linear in parameters (here <span class="math-container">$\beta_1$</span> and <span class="math-container">$\beta_2$</span>):</p>
<p><span class="math-container">$$\ln (q) = \ln (a) + \beta_1 \ln (p) + \beta_2 \ln (x) + e$$</span></p>
<ol start="3">
<li><p>Another problem is that you don't include any control variables. You should include several of them - anything you think can affect quantity demanded aside from price should be ideally controlled for (and remember you should expand your sample to always have at least 25-30 observations per independent regressor in a parametric model).</p>
</li>
<li><p>Even though demand is estimated with models that employ regressions, using just simple OLS is inappropriate. Supply-Demand is an endogenous system. Price affects quantity demanded and quantity demanded affects price at the same time and the same holds for supply.</p>
</li>
</ol>
<p>Hence you cannot simply run two independent OLS and then equate them to determine equilibrium price. You should  model this as an endogenous system where both supply and demand are modeled at the same time. There are also further issues that I did not explore here but these are already quite severe and will lead to biased coefficients and/or wrong inference.</p>
<p>Writing a tutorial for estimating supply and demand relationship is completely beyond the scope of Stack Exchange, and what is the best way might vary from case to case, but if you want to see an example of how to properly estimate supply-demand relationship it can be found in this paper from <a href="https://www.hbs.edu/faculty/Publication%20Files/19-051_968c31b8-518c-43d0-ae3a-fdaf81a2b3d3.pdf" rel="nofollow noreferrer">MacKay &amp; Miller (2018)</a>.</p>

CC BY-SA 4.0
2020-09-09T20:18:47.943Z
Thanks for the reply, it looks like I still have a long way to go ...
Kmeans
CC BY-SA 4.0
2020-09-09T18:24:45.937Z
2023-02-16T07:51:27.570Z
2023-02-16T07:51:27.570Z
1muflon1
<p>I did a linear regression on quantity sold and price for a good and simply the coefficients don't make any sense. number of observations = 16</p>
<p>Demand=1868 -14*P</p>
<p>Suply=0 +45*P</p>
<p>So p*= 1421.778  and Q*= 31.59507</p>
<p>Is there an error in the calculations? the P* =\$1421,778  does not make any sense since the product price is \$79. would it be due to the low number of observations? Or is a linear model not the most suitable for estimating a demand curve? if so which one would be best?</p>

CC BY-SA 4.0
2020-09-10T04:54:38.940Z
I think you reversed price and quantity! Equating your demand and supply gives P* ~ $32.
nanoman
<microeconomics><supply-and-demand>
What is the best way to estimate a demand curve?
Kmeans
# What is the best way to estimate a demand curve?

(Asked by: username_0 on 2020-09-09)

I did a linear regression on quantity sold and price for a good and simply the coefficients don't make any sense. number of observations = 16

Demand=1868 -14\*P

Suply=0 +45\*P

So p\*= 1421.778 and Q\*= 31.59507

Is there an error in the calculations? the P\* =\$1421,778 does not make any sense since the product price is \$79. would it be due to the low number of observations? Or is a linear model not the most suitable for estimating a demand curve? if so which one would be best?

**Tags:** microeconomics, supply-and-demand

> **Comments:**
> **username_1**: I think you reversed price and quantity! Equating your demand and supply gives P* ~ $32.  

---

## 2 answers

### Answer by username_2 on 2020-09-09. Score: 7 | Accepted answer

The approach you use has various problems.

1. Yes you need more than 16 observations. In most parametric models (including OLS) as a rule of thumb you need at least 25-30 observations per independent regressor (see Newbold et al statistics for business and economics for example).
2. You can use a linear model but you should not assume demand is a linear function of price. OLS is a model that is linear in its parameters but that does not mean necessarily that the relationship between two variables should be modeled in a linear way.

For example, a more realistic assumption about demand would be given by the following function:

$$q = a p^{\beta\_1} x^{\beta\_2}$$

where, $q$ is quantity, and $x$ some control variable, which is not linear but after taking logs of both sides this demand can be modeled by OLS because OLS needs to be just linear in parameters (here $\beta\_1$ and $\beta\_2$):

$$\ln (q) = \ln (a) + \beta\_1 \ln (p) + \beta\_2 \ln (x) + e$$

3. Another problem is that you don't include any control variables. You should include several of them - anything you think can affect quantity demanded aside from price should be ideally controlled for (and remember you should expand your sample to always have at least 25-30 observations per independent regressor in a parametric model).
4. Even though demand is estimated with models that employ regressions, using just simple OLS is inappropriate. Supply-Demand is an endogenous system. Price affects quantity demanded and quantity demanded affects price at the same time and the same holds for supply.

Hence you cannot simply run two independent OLS and then equate them to determine equilibrium price. You should model this as an endogenous system where both supply and demand are modeled at the same time. There are also further issues that I did not explore here but these are already quite severe and will lead to biased coefficients and/or wrong inference.

Writing a tutorial for estimating supply and demand relationship is completely beyond the scope of Stack Exchange, and what is the best way might vary from case to case, but if you want to see an example of how to properly estimate supply-demand relationship it can be found in this paper from [MacKay & Miller (2018)](https://www.hbs.edu/faculty/Publication%20Files/19-051_968c31b8-518c-43d0-ae3a-fdaf81a2b3d3.pdf).

> **Comments:**
> **username_0**: Thanks for the reply, it looks like I still have a long way to go ...  

---

### Answer by username_1 on 2020-09-10. Score: 1

Here's a more basic issue with the meaning of the analysis.

You say the demand curve came from regression, but you don't say whether you got the supply curve the same way.

You should be clear about what your observations represent. What was different about the observations and calculations used to estimate demand versus those used to estimate supply? Why was the price changing at all? E.g., was the seller deliberately adjusting the price as an experiment?

If all observations were of a price and quantity in equilibrium, then the observations would systematically vary only due to *changes* in one curve or the other. If only the supply curve changed, then the observations could estimate the stable demand curve; and vice versa. If both curves changed, then the observations follow neither a supply curve nor a demand curve.


---

