How to realize the regression without constant term in R language
This article will explain in detail how to realize the regression without constant terms in R language. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Regression without constant term (intercept term)
The lm () function in R contains constant terms by default, which can be achieved without constant terms by adding 0 or minus 1:
Lm (formula = mpg~cyl,data=mtcars) # contains constant terms
Lm (formula = mpg~cyl+0,data=mtcars) # not included
Lm (formula = mpg~cyl-1,data=mtcars) # there is a big gap between R2 and non-constant results, depending on the actual situation.
This is the end of the article on "how to achieve regression without constant terms in R language". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.