The attached example dataset contains 14 rows of a single string variable called Year. In most rows, Year just contains the 4-digit year (e.g., "1992") but in a few rows there is a superscript (e.g., "19921").
I would like to flag the rows with a superscript. Here is how I try to do that:
But this doesn't work. In every row the value of superscript is 0.
What's a better way to do this?
Thanks!
Paul
I would like to flag the rows with a superscript. Here is how I try to do that:
Code:
use example, clear gen superscript = (substr(Year,-1,1) == "¹") list
What's a better way to do this?
Thanks!
Paul
Comment