Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstepAIC forward regression fails when model contains inline functions #10
Comments
|
> library(olsrr)
> library(caret)
> data("Sacramento")
> lm_fit1 <- lm(log(price) ~ . - city, data = Sacramento)
> ols_stepaic_forward(lm_fit1)
-----------------------------------------------------------------
Variable AIC Sum Sq RSS R-Sq Adj. R-Sq
-----------------------------------------------------------------
sqft 740.1894 137.191 119.967 0.533 0.533
zip 470.1746 179.391 77.767 0.698 0.674
type 421.4182 183.671 73.487 0.714 0.691
baths 419.5139 183.978 73.18 0.715 0.692
-----------------------------------------------------------------
> lm_fit2 <- lm(price ~ beds + baths + log(sqft), data = Sacramento)
> ols_stepaic_forward(lm_fit2)
------------------------------------------------------------------------------------
Variable AIC Sum Sq RSS R-Sq Adj. R-Sq
------------------------------------------------------------------------------------
log(sqft) 23833.104 9090748642827.41 6917101778647.02 0.568 0.567
beds 23784.59 9455673761296.46 6552176660177.97 0.591 0.59
------------------------------------------------------------------------------------ |
ols_stepaic_forward()returns an error when the model formula contains inline functions.Session Info