I just started working on this problem. I am trying to impute missing value for “Married” column. As this has only 3 missing values I tried to impute them as “No”. I used below code to impute but it is not working. Tried with different options but I am not getting any error but the missing value is still there.
loan_dat$Married[which(is.na(loan_dat$Married))] <- "No"
loan_dat$Married <- ifelse(is.na(loan_dat$Married), "No", loan_dat$Married)
Married column is categorical and not factor in my dataframe.
Any help please.