I can't figure out how this is possibly happening in Stata. The data are integers with no missing values.
gen aid=bid*10000+cid
gen temp=0
replace temp=1 if aid!=bid*10000+cid
sum temp
The mean of temp equals 0.27, and I can see many places where the variable aid is not coded according to the formula. How is this possible? I have tried running it in Stata 12 and 13 and got the same results. In every case with an error aid is off by 1 or 2 in the ones digit.
Here is a reproducible example:
set obs 1
gen wid=2107
gen fid=2104
gen mid=fid*10000+wid
di mid
help data typesandhelp float.gen wid=2107gen fid=2104gen mid=fid*10000+widdi mid21042108