For the command underneath '# loop through different percentages of masked data to calculate error in the imputation at these percentages.' I am having some issues with the data I put in. First, if I leave the code as is, the obs.to.delete function deletes too much of my data to run it through the impute.knn argument (I get an error that says some of my columns are missing 80% of the data). To get around this I changed the percent loop so it only reads in sequence up to .25, still by 0.05. However, when I do this I the graph readout is very... funky. There are multiple points for each proportion of missing data and the line is not going in a linear direction from left to right. Any advice?

Created by David Presby presbyd
Thanks Jonathan, it looks like my 'threshold' vector has 75 values. I'm not sure how that happened, but I'll try to troubleshoot the problem from there.
For the multiple points issue, are you initializing your vectors? you need multiple vectors for each method of imputation. Check your vector values in R studio it will show you how many values you have in the vector. For 25% in increments of 5 you should have 5 values in your vector. As for the funky graph, I'm not sure what is happening there.

Imputation Issues page is loading…