TransWikia.com

Getting Different R-squared for Same Model Equation

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:

  1. Why it is happening?
  2. What are the alternative of R-squared, Adjusted R-squared which can catch this loophole?
  3. Will this method give higher R-squared, Adjusted R-squared for any data?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP