Linear model function lm() error: NA/NaN/Inf in foreign function call (arg 1)

后端 未结 10 1200
天涯浪人
天涯浪人 2020-12-03 09:49

Say I have data.frame a

I use

m.fit <- lm(col2 ~ col3 * col4, na.action = na.exclude)

col2 has some <

10条回答
  •  星月不相逢
    2020-12-03 10:27

    I got this error when I inverted the arguments when calling reformulate and use the formula in my lm call without checking, so I had the wrong predictor and response variable.

提交回复
热议问题