Prediction and validation with log regression

Hi,
I have 2 regressions I'm trying to evaluate, both are based on the same data, but the second regression has log transformation:

reg<-lm(AmountSpent~Age+Children+Catalogs+Gender+Married+Location+Salary,data=train.df)
summary(reg)
pred.train<-predict(reg)
library(forecast)
accuracy(pred.train,train.df$AmountSpent)
pred.valid<-predict(reg,newdata = valid.df)
accuracy(pred.valid,valid.df$AmountSpent)
reg.log<-lm(log(AmountSpent)~Age+Children+Catalogs+Gender+Married+Location+log(Salary),data=train.df)
summary(reg.log)
pred.train.log<-predict(reg.log)
accuracy(exp(pred.train),train.df$AmountSpent)
pred.valid.log<-predict(reg.log, newdata = valid.df)
accuracy(exp(pred.log),valid.df$AmountSpent)

The questions I have are regarding the second regression:

  1. Is it okay to use log only on one (or some) independent variables, while the rest of the variables remains the same?
  2. When I use accuracy(exp- it changes the value only for variables with log, or changes the value for all variables in the regression?
  3. Do I need to use the exp function on both the prediction and validation or just the validation?

Thanks!!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.