As you can see, the ordinal factor variable is also a number on a Likert-like scale, where 3 is perceived as worse than 1.
Yet, one of the routines I've been working with recently only accepts numeric variables. Therefore, I wondered if it was possible to transform it into 'as.numeric', but command that 3<2<1?
Hi @technocrat. I appreciate your feedback, but the problem is with my variable expressed as a levelled factored and the procedure I am using only considers numeric variables.
If your real life issue is exactly like your example, you would seem to get your requirement trivially. If your example does not represent your real life challenge, more finesse is likely required.
In this example we have data 3,2,1,2,3,1,2 because you have set the factor as ordinal the integer representation of the factors is already numbers that map directly to the old 3/2/1 are themselves 1/2/3 so now as you go through the vector ; where you had a 3 before you have a 1 , where you had a 2 you keep 2's and where you had 1s you have 3.