cancel
Showing results for 
Search instead for 
Did you mean: 

R-Multiple Linear Regression giving error while handling missing values for keep option

Former Member
0 Kudos

On selecting keep option in  R-Multiple Linear Regression for handling missing values the following error came from R side

R-Multiple Linear Regression:An error occurred while executing commands in R environment

Details:

Cause:Error from R:"Error in lm.fit(x,y,offset=offset,singular.ok=singular.ok,..):

   NA/Nan/Inf in 'X'

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If SAP PA is passing na.action=na.pass than this will not work in R regression algorithms

That's why keep option for handling missing values is throwing  following error

lm(ctl~trt,na.action=na.pass)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  NA/NaN/Inf in 'x'


The above error is coming when I am running algo directly in R

Former Member
0 Kudos

Hi,

What is the format of your dataset ?

I have the same error with PA with a .csv dataset.

So I open my dataset directly with R. The problem is empty values are not NULL but NA. Diffrences are explained here : http://www.r-bloggers.com/r-na-vs-null/

And I have the same error when I try to launch a regression with R.

I don't know how SAP Predictive Analysis read empty data.

My answer is not complete, but I hope it helps to understand the problem and helps someone else to fix it.

You can use InfiniteInsght regression if you want to keep empty values in your dataset.

Edouard

Former Member
0 Kudos

Thanks  Edouard KOLF  for replying

I got your point SAP PA is sending NA values for Missing values.I tried the same multiple linear regression in R.When we read CSV in R it treats blank values as NA.

For handling NA values in lm function with na.action parameter we have to pass na.omit or na.exclude.But I don't know how sap is using this

For Ignore case they must be passing na.action=na.omit

For Stop case they must be passing na.action=na.fail

But for keep case I don't know what they are passing and why it is failing