Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
351 views
in Technique[技术] by (71.8m points)

r - Imputation using robComputation gives error message

I have a dataset with a rather large portion of missing values. I'm trying to do imputation using robComposition. But I keep getting the error message: "Error in quantile.default(d, k/length(d)) : missing values and NaN's not allowed if 'na.rm' is FALSE". This does not make sense to me. Why would missing values not be allowed if I'm trying to impute missing values? Here's a small subset of the data and code to reproduce the error

library(robCompositions)
p <- c(1.000000,2.083333,1.333333,1.166667,4.250000,1.083333,2.083333,1.166667,1.000000,1.000000) 
i <- c(1101.25,1675.00,2500.00,1612.50,NA,1750.0,600.00,0.00,1530.00,3158.50)
s <- c(34000,1550,NA,2750,375,1750,30000,20000,NA,NA)
x <- data.frame(p,i,s)
imp <- impCoda(x)
question from:https://stackoverflow.com/questions/65844382/imputation-using-robcomputation-gives-error-message

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After contact with one of the authors of robComposite it became apparant that I need to use imri() in the package VIM to impute data for non-composite models.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...