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 backward regression fails when model formula contains inline functions #9
Comments
|
> library(olsrr)
> library(caret)
> data("Sacramento")
> lm_fit1 <- lm(log(price) ~ . - city, data = Sacramento)
> ols_stepaic_backward(lm_fit1)
Backward Elimination Summary
----------------------------------------------------------------
Variable AIC RSS Sum Sq R-Sq Adj. R-Sq
----------------------------------------------------------------
Full Model 424.239 73.08 184.078 0.716 0.691
beds 422.292 73.084 184.074 0.716 0.692
longitude 420.737 73.119 184.039 0.716 0.692
latitude 419.514 73.18 183.978 0.715 0.692
----------------------------------------------------------------
> lm_fit2 <- lm(price ~ beds + baths + log(sqft), data = Sacramento)
> ols_stepaic_backward(lm_fit2)
Backward Elimination Summary
-----------------------------------------------------------------------------
Variable AIC RSS Sum Sq R-Sq Adj. R-Sq
-----------------------------------------------------------------------------
Full Model 23785.63 6545434636666.82 9462415784807.67 0.591 0.59
baths 23784.59 6552176660177.97 9455673761296.53 0.591 0.59
----------------------------------------------------------------------------- |
ols_stepaic_backward()returns an error when the model formula contains inline functions.Session Info