![](/img/trans.png)
[英]Tobit : Error in lm.fit(X.vlm, y = z.vlm, …) : NA/NaN/Inf in 'x' (simulated data)
[英]Error in .lm.fit(x, y) : NA/NaN/Inf in 'x' in R
我一直試圖通過以下方式使用灰盒中的關聯來查找我的數據集中所有分類和數字之間的相關性 -
library(readxl)
library(timeDate)
library(greybox)
library(dplyr)
library(mice)
library(Hmisc)
carData33 <- read.csv("carData.csv")
#removing the first column since its not necessary, it represents the ID number
carData33 <- carData33[,c(2:15)]
#replacing NA with 0
carData33[is.na(carData33)] <-0
assoc(carData33)
主要目標是通過選擇具有相關值的變量來進行回歸。
這樣做時,彈出的錯誤是-
Error in .lm.fit(x, y) : NA/NaN/Inf in 'x'
In addition: Warning message:
In .lm.fit(x, y) : NAs introduced by coercion
在包含分類數據的列上使用 as.factor()。 像test$manufacturer <- as.factor(test$manufacturer)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.