R 阿米莉亚

R 阿米莉亚,r,missing-data,R,Missing Data,即使在AMELIA中应用边界,我也不能有正输入,我的结果中有一些负数,还有一个警告: 警告消息: 1:在min(x)中:min没有未丢失的参数;返回Inf 2:在max(x)中:max没有未丢失的参数;返回-Inf 我的代码是: library(Amelia) data <- read.table(file='Test.csv', sep=',', header=T, row.names=1) x <- 30106 y <- 1 bds <- matrix(c(3,

即使在AMELIA中应用边界,我也不能有正输入,我的结果中有一些负数,还有一个警告:

警告消息:
1:在min(x)中:min没有未丢失的参数;返回Inf
2:在max(x)中:max没有未丢失的参数;返回-Inf

我的代码是:

library(Amelia)

data <- read.table(file='Test.csv', sep=',', header=T, row.names=1)

x <- 30106
y <- 1

bds <- matrix(c(3, y, x), nrow = 1, ncol = 3)

a.out.bsd <- amelia(data, bound = bds, max.resample = 10, ords=c("distance_to_center", "stars", "city_id"))

out <- range(a.out.bsd$imputations$imp1[is.na(data[, 3]), 3])

write.amelia(obj=a.out.bsd, file.stem="Trivago", format="csv")
库(阿米莉亚)

数据我找到了答案,当你不把任何索引号列出来时,就会发生这种情况,似乎阿米莉亚需要这个来应用边界

hotel_id    city_id clicks  stars   distance_to_center
1155796537382564554

2 155827306 738 NA 4 624

3 155858459 738 349 4 434

4 155889612 738 NA 4 5391

559207657723922

6155951918772104750

71559830717723133

8156014224772 035411

9 156045377 772 0 4 4757