I have a project to estimate commercial real estate properties given categorical and continuous variables. I have ran a step-wise linear regression model to pick out a good formula in RStudio. (Adj. Rsq = .90 also, I know I need to do PCA and some type of categorical ANOVA test still, but I just want to get a beta estimator out before going deeper.)
How do I take the resulting output from my step(lm()) function and create an character based algebraic expression/equation with the coefficients, like:
- log(price)= M1X1 + M2X2 + ... + MnXn.
Where M is my coefficient, and X is my variable. I know I could do it by hand in excel but with so many interactions and base variables it seems excessive. Maybe there is a function in R, or I could make a function in python that would ask what are the values for the variables needed for the calculation; but I haven't thought of any.
Thank you so much! If anything is not specific enough I will do my best to further explain.