0

when using the "mice::densityplot", I get a graph in which the range of values in the x axis do not correspond to the range of values of the imputed and non imputed data (from 0 to 10). In the attached densityplot (see image) there appears to be values ranging from -5 to 15.

This is the code that I have used:

if(fit_models == 1){
  mice_densityplot <- mice::densityplot(mice_data)
  png(file.path(dirname(getwd()),"output/mice_densityplot.png"), width = 1000, height = 1000)
  print(mice_densityplot)
  dev.off()
}

I have checked the range of values of both the imputed and nonimputed data and they are correct, it is just the densityplot that is created that does not correspond to the ranges of values. densityplot

jrcalabrese
  • 2,184
  • 3
  • 10
  • 30
  • Can you provide a reproducible example? https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – jrcalabrese Jun 14 '23 at 15:39

0 Answers0