Dear listers
I have data that looks like this
cropcode varcode
116 11603
115 11599
223 22309
The first variable is the code for different crops while varcode is the
specific variety. As you can see from the example, the variety code comes
from crop code (the first three digits are the crop codes).
I am cleaning the data and I would like to flash out cases where the
varcode is not consistent with the cropcode such as
cropcode varcode
116 11503
^
How can I do this in stata?
Use the -int- function (see -help functions-). In this case, you might type