Hi,
This is a sample of my data:
id year code code2 test check
2 2015
2 2016 85182100 85182100 85182096 4
3 2012
3 2013
3 2014
3 2015
3 2016 85182100 85182100 85182096 4
4 2012
4 2013
4 2014
4 2015
4 2016 85182100 85182100 85182096 4
5 2012
5 2013
5 2014
5 2015
5 2016 85182100 85182100 85182096 4
.......
Variable "code" is in string form.
This is what I did:
I'm pretty sure I literally just copied variable code2 into the column for variable test, however, the values for some of the observations seem to be different from what it should be. The incorrect values are always = code2 +/- {1,2,3,4}. There are others were correctly copied.
When I browse the dataset, instead of showing test = 85182096, it shows 8.52e+07. I reformatted it so that variable test shows all the digit as shown above. I don't think this would cause the above problem, however?
I don't really know why or how this would be the case? It seems really bizarre to me. Thank you for your help.
This is a sample of my data:
id year code code2 test check
2 2015
2 2016 85182100 85182100 85182096 4
3 2012
3 2013
3 2014
3 2015
3 2016 85182100 85182100 85182096 4
4 2012
4 2013
4 2014
4 2015
4 2016 85182100 85182100 85182096 4
5 2012
5 2013
5 2014
5 2015
5 2016 85182100 85182100 85182096 4
.......
Variable "code" is in string form.
This is what I did:
Code:
gen code2 = code1 destring code2, replace gen test = code2 gen check = code2-test
When I browse the dataset, instead of showing test = 85182096, it shows 8.52e+07. I reformatted it so that variable test shows all the digit as shown above. I don't think this would cause the above problem, however?
I don't really know why or how this would be the case? It seems really bizarre to me. Thank you for your help.
Comment