I'm trying to create a new id for a dataset by generating a linear combination from the original ID. But, Stata doesn't gen the calculations right.
The Command was:
gen new_id=Original_id*13 +3
Above you can ese the Original ID, then multiplying this by 13, and then adding 3. The last two columns are the same operations done by MS Excel. Sometimes, Stata is adding 4 in "new_id", or the multiplication by 13 is wrong, as i've verified this with the display Command.
thanks to anyone who can help me with this.
The Command was:
gen new_id=Original_id*13 +3
Code:
Original_id id_13 new_id _x13 _3 4041460 52538980 52538984 52538980 52538983 4041351 52537564 52537568 52537563 52537566 1002405720 13031274496 13031274496 13031274360 13031274363 1110596439 14437753856 14437753856 14437753707 14437753710 1110596439 14437753856 14437753856 14437753707 14437753710 3736456 48573928 48573932 48573928 48573931 end
Above you can ese the Original ID, then multiplying this by 13, and then adding 3. The last two columns are the same operations done by MS Excel. Sometimes, Stata is adding 4 in "new_id", or the multiplication by 13 is wrong, as i've verified this with the display Command.
thanks to anyone who can help me with this.
Comment