Hello, I am doing a job for my university and I need help, could you give it to me? I am new to stata, I would like to know how I can filter a variable by its third digit. Basically I need to create a new variable that is, for example, equal to 1 if the third digit of the variable X is equal to 9, equal to 2, if the third digit of the variable X is equal to 5, etc. Thank you.
PS: the variable on which I must filter is numeric and has a total of 5 digits.