Skip to Content
avatar image
Former Member

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

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'

Error.PNG (8.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 24, 2014 at 10:47 AM

    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


    na.png (7.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Dec 26, 2014 at 07:03 AM

    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

    Add comment
    10|10000 characters needed characters exceeded