I have a base MLR model of data that has 8 numeric predictors and 3 categorical predictors. The response is whole number numeric values.
My base model has some mild regression assumption violations (non-normality of residuals shown below) so I tamed them by utilizing a log10 transform.
I transformed the response as well as the numeric variables and left the categorical predictors alone. I also offset each predictor by 1 + min(that variable) to get around any sort of NAs that are results of the log10 transform (for negative values).
Now my goal is to compare the MSE from this model to other future models (Random Forest, SVM, Regularized Regression, etc.). I want to be able to compare this model's MSE to other models (that don't use transformations). So I need to get the residuals in terms of original units.
How exactly would I go about doing so? The inverse of y = log10(x)
is of course 10^y = x
but how can I do this with the model's $residuals
to get the residuals in non-transformed units?
Since some of my variables are categorical how does this effect my un-transformation?
# R Code for MLR model
mlr_fit_3_log <- lm(log10(Rented_Bike_Count + 1 - min(bike2$Rented_Bike_Count)) ~
log10(Hour + 1 min(bike2$Hour)) +
log10(Temperature + 1 - min(bike2$Temperature)) +
log10(Humidity + 1 - min(bike2$Humidity)) +
log10(Wind_speed + 1 - min(bike2$Wind_speed)) +
log10(Visibility + 1 - min(bike2$Visibility)) +
log10(Solar_Radiation + 1 - min(bike2$Solar_Radiation))+
log10(Rainfall + 1 - min(bike2$Rainfall)) +
log10(Snowfall + 1 - min(bike2$Snowfall)) +
Seasons + # factor
Holiday + # factor
Functioning_Day # factor
- Dew_point_temperature, data = Train_set)
# Calculate MSE model
mse <- function(fit_obj){
mean(fit_obj$residuals^2)
}