If you can specify a numerical value for the variables, then you may have a solution. You must rename the values ββto numbers, and then convert the variable to numeric. Here's how:
library(plyr) my.data2$islamic_leviathan_score <- revalue(my.data2$islamic_leviathan, c("(1) Very Suitable"="3", "(2) Suitable"="2", "(3) Somewhat Suitable"="1", "(4) Not Suitable At All"="-1")) my.data2$islamic_leviathan_score_1 <- as.numeric(as.character(my.data2$islamic_leviathan_score))
This overestimates the potential values ββwhen converting the variable as numeric. The results are consistent with the original values ββcontained in the data set when the variables are factors. You can use this solution to change the name of the variables to whatever you like and convert them to numeric variables.
Finally, it's worth it because it allows you to draw histograms or regressions, which is not possible with variable factors.
Hope this helps!
saladin1991
source share