Can someone explain how to mathematically perform linear regression on some data while constraining the fit line to pass through the $(0,0)$ point?
Asked
Active
Viewed 64 times
0
-
1Hi. I removed the contextual info about the module. I just want to understand how to make it wiyh pen and paper. – Liviu Oct 14 '15 at 20:34
-
You are just suppressing the intercept. This is straightforward. – gung - Reinstate Monica Oct 14 '15 at 20:50
-
But won't that just translate the entire fit line to cross the origin ? I don't want to translate it, i want the slope of a line that starts from origin and fits the data as best as possible given the constraint. I think your sollution will yeld the slope of the unconstrained fit line. Am I wrong ? – Liviu Oct 15 '15 at 06:10
-
No, it isn't a vertical shift. If you use the equation I list at the linked thread you will get a different regression line. It may help to read my answer here: [What does the formula y ~ x + 0 in R actually calculate?](http://stats.stackexchange.com/a/174299/7290) – gung - Reinstate Monica Oct 15 '15 at 15:26
-
yes, i implemented that and it worked. thanks ! Any ideea how to compute standard error and standard deviation on them ? I am currently computing it using the standar error formula but i am replacing the average Y with X*slope in sum( (Y-Yavg)^2 ). is that correct ? – Liviu Oct 15 '15 at 18:07
-
I'm not sure. You could ask a new question for that. – gung - Reinstate Monica Oct 16 '15 at 04:48