You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
if I correctly understand #15, your second statement is incorrect; you write,
replace Vacc=0 if mi(Vacc)
but you should be writing:
Code:
replace Vacc=0 if Immu!=1 & Immu!=.
replace Vacc=. if Immu==.
note that since you did not provide a data example, I can't be sure that you need both of those (or that they are correct), but your code does exactly what you don't want
I’m really in doubt if the query is clear to me. In short, if you wish ‘1’ for yes and rest as missing values, you just need to apply the first line of the code you shared, and forget about ‘replace’. If it is the opposite way, you can you the command I shared.
Comment