Hello, I am following up some readings and came across this code:
bysort v001: gen dif = 0
replace dif = 1 if v001 == v001[_n-1] & wt2 != wt2[_n-1]
browse if dif == 1
count if dif==1
I can see the code is trying to check for an error or consistency, and replacing missing values.
But could you please clarify what it is exactly doing, and what answer one should be looking for in the two conditions:
count if dif ==1 or if dif == 0?
if count if dif == 1 reports 7,000 cases, what does it mean?
Thanks in advance...Cy
bysort v001: gen dif = 0
replace dif = 1 if v001 == v001[_n-1] & wt2 != wt2[_n-1]
browse if dif == 1
count if dif==1
I can see the code is trying to check for an error or consistency, and replacing missing values.
But could you please clarify what it is exactly doing, and what answer one should be looking for in the two conditions:
count if dif ==1 or if dif == 0?
if count if dif == 1 reports 7,000 cases, what does it mean?
Thanks in advance...Cy
Comment