Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the regression without constant term in R language

Shulou Source: shulou.com Published: 2022-06-01 03:10:41 10月25日 Update

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.

Tags: Constant article language more good practical content function can pass actual gap situation article knowledge result reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Technology Docker Huawei vpn