I have a dataset with 3500 companies. Each company has a unique company ID (variable name is id), which is all number (To be precise, the data type is long $12.0g when I use inshee to load the data).
I can use reg y x i.id

I also tried
tostring id, gen(id2)
encode id2, gen(id2_c)
then
reg y x i.id2_c

I thought the two should have given me the identical result on x, but the fact is they are not. I am puzzle why is that. Your help would be greatly appreciated.