---------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Dear all ,
I am trying to replace all observation by second observation of wbc if serial is duplicated.The funny thing I have noted is that if there is only a single serial for example serial 158104 in my case, wbc is being replaced with a non-existing observation. In my case (serial 158104) the value of wbc=4.8.
when I do the below code, it is being replaced by missing.As if the serial is duplicated with second observation of wbc as missing.
by serial:replace wbc=wbc[2]
Is this a stata 17 bug or am I not getting something correct?
regards,
Fred Orwa
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str50 serial str16(mps mps1) byte Append_Source str50 wbc str8 rbc str13 mps_100wbc str16 mps_500rbc str43 species str4 mps_2000rbc str18 datah byte dups float sort1 "158104" "negative" "negative" 1 "4.8" "0.93" "" "" "" "" "paeds_MalariaSlide" 0 2 end label values Append_Source _append label def _append 1 "Appended dataset 1", modify
Dear all ,
I am trying to replace all observation by second observation of wbc if serial is duplicated.The funny thing I have noted is that if there is only a single serial for example serial 158104 in my case, wbc is being replaced with a non-existing observation. In my case (serial 158104) the value of wbc=4.8.
when I do the below code, it is being replaced by missing.As if the serial is duplicated with second observation of wbc as missing.
by serial:replace wbc=wbc[2]
Is this a stata 17 bug or am I not getting something correct?
regards,
Fred Orwa
Comment