Hi everyone,
I am not sure if this is the proper way to post. The code appears to replicate the mini dataset I created. Thank you for posting the macro. So what I need is a programmatic way to identify that the values for variable _4 are all zeros for every entry for items 1-9 and then to set these values to missing.
Cristian
data MINI2;
infile datalines dsd truncover;
input ITEM:BEST12. _0:32. _1:32. _2:32. _3:32. _4:32.;
format ITEM BEST12.;
datalines4;
1,0,0,0,1,0
1,0,0,0.5,0,0
1,0,0,0.5,0.5,0
1,0,0,0.5,1,0
1,0,0.5,0.5,0,0
1,0.5,0,0,0,0
1,0.5,0.5,0,0,0
1,0.5,0.5,0.5,0,0
1,1,0,0,0,0
2,0,0,0,1,0
2,0,0,0.5,0,0
2,0,0,0.5,0.5,0
2,0,0,0.5,1,0
2,0,0,1,0,0
2,0,0.5,0.5,0,0
2,0.5,0,0,0,0
2,0.5,0.5,0,0,0
2,0.5,0.5,0.5,0,0
2,1,0,0,0,0
3,0,0,0,1,0
3,0,0,0.5,0,0
3,0,0,0.5,0.5,0
3,0,0,0.5,1,0
3,0,0.5,0,0,0
3,0,0.5,0.5,0,0
3,0.5,0,0,0,0
3,0.5,0.5,0,0,0
3,1,0,0,0,0
4,0,0,0,0.5,0
4,0,0,0,1,0
4,0,0,0.5,0.5,0
4,0,0.5,0,0,0
4,0,0.5,0.5,0,0
4,0,0.5,0.5,0.5,0
4,0,1,0,0,0
4,0.5,0.5,0,0,0
4,1,0,0,0,0
4,1,0.5,0,0,0
5,0,0,0,0.5,0
5,0,0,0,1,0
5,0,0,0.5,0,0
5,0,0,0.5,0.5,0
5,0,0.5,0,0,0
5,0,0.5,0.5,0,0
5,0.5,0.5,0,0,0
5,1,0,0,0,0
5,1,0.5,0,0,0
6,0,0,0,0.5,0
6,0,0,0,1,0
6,0,0,0.5,0.5,0
6,0,0.5,0,0,0
6,0,0.5,0.5,0,0
6,0,0.5,0.5,0.5,0
6,0,1,0,0,0
6,0.5,0.5,0,0,0
6,1,0,0,0,0
6,1,0.5,0,0,0
7,0,0,0,1,0
7,0,0,0.5,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