Hi everyone,
I have encountered similar issue whereby someone posted before. I had check my data frame all are numeric. Despite i followed the method proposed the result still the same. Appreciate anyone if can assist.
p/s: If I run for normal lm without log, it will be fine. However i need to build a better model as the p-value is more than 0.05
'data.frame': 50 obs. of 4 variables:
RDSpend : num 165349 162598 153442 144372 142107 ...
Administration: num 136898 151378 101146 118672 91392 ...
MarketingSpend: num 471784 443899 407935 383200 366168 ...
Profit : num 192262 191792 191050 182902 166188 ...
model_profit2 <- lm(Profit ~ RDSpend + log(MarketingSpend), data = Startups50)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'x'
Startups50$RDSpend <- as.numeric(gsub("\.", "", Startups50$RDSpend))
FIT <- lm(Profit ~ RDSpend + log(MarketingSpend), data = Startups50)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'x'