Cross Validated Asked on November 9, 2021
I have built two linear model in R using ‘lm’ function with some tricks as follows:
Model-1: With default option
l1 <- lm(dist ~ speed, data = cars)
Model-2: Supplying the constant intercept (=1) variable manually and ‘without Intercept’ option
Intercept = rep(1,50)
l2 <- lm(dist ~ 0 + Intercept + speed, data = cars)
summary(l1) # Multiple R-squared: 0.6511, Adjusted R-squared: 0.6438
summary(l2) # Multiple R-squared: 0.9091, Adjusted R-squared: 0.9053
I have noticed, though both the model equation are identical but the R-squared and Adjusted R-squared has been increased significantly in the 2nd model. My questions are:
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP