title: Is imputing median for NAs in a dataset the best approach. If yes/no, so why?
body: <p>I am trying to carry out some data cleaning. My data includes survey questions answered by respondents on a scale of 1 to 5(factor type data). I had a few NAs in my dataset. I have 49 variables. Now i want to impute the NAs in each column with the median of that column.</p>
  
  <p>I tried to convert data to numeric to be able to get medians &amp; after that i tried to convert list to dataframe but it didn't work.</p>
  
  <pre><code># Replacing NAs with median
  # data.class(data3$column)
  data4 &lt;- lapply(data3,as.numeric)
  median(data4$ER_ALLVIS)
  
  # Replacing NAs with median
  data5 %&gt;% 
    mutate_all(~ifelse(is.na(.), median(., na.rm = TRUE), .))
  </code></pre>
  
  <p>i want to impute the NAs in each column with the median of that column.</p>