Could anyone offer advice on the following
(i) generating a variable which displays the percentage of data with a specific value (in this case .a) within a range of variables - as var6 does below - i.e. the percentage of .a values in vars 1-5 for each case.
(ii) I'm also looking for a way to count .a values, but taking the .b cells out of the equation so that for each case the .b variables are essentially ignored and the new variable becomes the percentage of .a values in vars 1-5 (where vars don't equal .b) as is done in var7.
Does that make sense? Any thoughts much appreciated!
(i) generating a variable which displays the percentage of data with a specific value (in this case .a) within a range of variables - as var6 does below - i.e. the percentage of .a values in vars 1-5 for each case.
(ii) I'm also looking for a way to count .a values, but taking the .b cells out of the equation so that for each case the .b variables are essentially ignored and the new variable becomes the percentage of .a values in vars 1-5 (where vars don't equal .b) as is done in var7.
ID | var1 | var2 | var3 | var4 | var5 | var6 | var7 |
1 | 10 | 18 | 251 | 21 | 0 | 0 | 0 |
2 | 8 | 5 | 45 | 2 | .a | 20 | 20 |
3 | .b | .b | .a | 6 | 16 | 20 | 33.33 |
4 | .a | .a | .a | .a | 1 | 80 | 80 |
5 | 13 | .a | .b | 81 | 11 | 20 | 25 |
6 | 25 | .a | .a | 12 | 199 | 40 | 40 |
7 | 16 | 6 | 34 | 15 | 78 | 0 | 0 |
Comment