Hello,
I hope I post this question in the right forum.
I am building a regression model:
> m2 = lm(log(abs(MarginDollars)) ~
CUST_REGION_DESCR+log(abs(Sales))+QtySold+log(abs(MFGCOST))+
PRODUCT_SUB_LINE_DESCR, data)
The reason why I used abs() is that some values in my variables are negative:
> summary(MFGCOST)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-3900.00 13.72 33.29 65.78 78.05 53138.51
> summary(QtySold)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-40.000 1.000 1.000 2.806 3.000 499.000
> summary(MarginDollars)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-2222.00 6.43 16.95 28.77 37.62 24316.27
The reason I am using log transformation is that some values in my object variables are pretty huge so log scale down the number to help me see the correlation better.
I am having an error message:
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :NA/NaN/Inf in 'x'
I did some checks:
> all(is.na(MarginDollars))
[1] FALSE
> all(is.na(log(abs(MarginDollars))))
[1] FALSE
> all(is.na(log(abs(MFGCOST))))
[1] FALSE
> all(is.na(log(abs(Sales))))
[1] FALSE
> all(is.na(CUST_REGION_DESCR)))
[1] FALSE
> all(is.na(QtySold))
[1] FALSE
> all(is.na(PRODUCT_SUB_LINE_DESCR))
[1] FALSE
If all of these involved variables do not have any NA's in them, so what does the error message tell me?
Thanks!