I want to categorized one variable with the next conditionals:
0 - 4: "fail" 5 - 7: "good" 8 - 10: "excellent" None of the above: NA
I tried using the recode function
The values of variable is numeric
segur <- data$segur
Created a new variable using recode
dt1 <- recode(segur, "c(0,4)='suspenso';c(5, 7)='aceptable';c(8,10)='excelente'; else='NA'")
dt1
How can I fix?