# On regressing data, should the $y$-intercept be forced to a value according to the model?

I have a theoretical model of the form $$y=kx$$ Say I experimentally measure the data pairs $$(y,x)$$, from which I want to determine the value of $$k$$. I am using the curve fitting feature of MS Excel (which I assume uses linear regression method). That is, I plot the $$y$$ data as a function of the $$x$$ data, and then apply a "linear" trendfit to the data plot to obtain the value for $$k$$. My data $$(y,x)$$ will undoubtedly have error (as discussed in answers and comments in this PSE post). In creating the curve fit, I have the option to set the y-intercept to zero, i.e., make the fitted line pass through the origin of the plot. This would be the result predicted by the theoretical model.

Alternatively, the curve fit can be made such that the y-intercept is the value the makes the best fit to the data, which would change the value determined for $$k$$.

Looking past the fact I am using MS Excel, what is the best practice for regressing data to find the parameter $$k$$? Should I force the regression to fit the data and the $$y$$-intercept at zero or not?

If you believe the model, you should find the slope by fitting $$y=kx$$. The least squares solution, for data with identical errors, is $$k=\overline{xy} / \overline{x^2}$$.

Should you believe the model? That is a totally different question. Don't get them confused. Calculating the $$\chi^2$$ would be a good place to start.

In any case you should not be using Excel for anything seriously scientific. Keep it for your expenses forms.

• To clarify, if the model for voltage is $V=IR$, and we have the data as shown in this PSE post (physics.stackexchange.com/questions/55534/…), the fit should be made so that the y-intercept is zero and we find the best value for $R$ (which is the slope of the line to the data with y-intercept = 0)? Commented Aug 10, 2021 at 19:27

If you are getting spring stretch data, the answer should be that you do not force the y intercept to be zero. For such data, new springs have some resistance to them that requires a small amount of force to be applied to them (e.g., a small hanging weight) before they will show any stretch. This is a real effect, is equivalent to an "overly compressed" spring, and is no doubt due to the spring manufacturing process. In addition, whether your process is stretching a spring or not, you should get data in the range that can verify if you are dealing with such an effect, and make sure that your mathematical model matches the experimental data.

• Agreed, the question about what is the best practice for regressing data to solve for parameters is an interesting one. On one hand, the finite intercept regression might tell you something about the data, e.g., it suffers some form of experimental error or it is subject to phenomena not accounted for in the model you assume governs it (your 'overly compressed' spring example). On the other hand, if all you know is the one “theoretical” model, and you believe that model to be “true”, then it seems you should pick the zero-intercept option to be in alignment with the model... Commented Aug 12, 2021 at 16:28
• ...Likewise, if this option shows the fit to the model to be “poor”, then it points out there is something awry with your measurements. If you were a spring manufacturer and had to report the spring constant $k$, according to the model $y=kx$, would it be best practice to use the zero-intercept approach to find $k$ and then report the uncertainty associated with that $k$? Commented Aug 12, 2021 at 16:30
• @Armadillo, for the spring example, once a small amount of weight is added to a "compressed" spring, it follows Hooke's Law, which can be demonstrated by experiment. Therefore, there is nothing wrong with using the equation that actually represents that particular spring, especially if you are using that spring as an element of another experiment. Commented Aug 12, 2021 at 18:40
• What if the y-intercept is a positive value? I.e., the best fit line shows that the spring is stretching when the force on the spring is zero. Do you still suggest I not force the y-intercept to be zero? Commented Aug 27, 2021 at 16:07
• @Armadillo, I think that you mean what if the y-intercept is negative (i.e., it takes compressive force to get the spring back to its original length and you are curve fitting spring length vs. stretching force). The answer depends on whether or not you are fitting the data to the spring's original length or the spring's stretched length. Commented Aug 27, 2021 at 17:58