Hello,
I have a small question regarding assert.
I want to check how many observations in a data are similar across a set of variables. Data example:
We can see that there are 4 observations that are similar across var1, var2, and var3 however when I use the assert command to check, I get the following message:
However, using the following code correctly identifies similar observations:
What is the possible explanation behind why we can not directly assert 3 variables and instead have to use the "&" condition
I have a small question regarding assert.
I want to check how many observations in a data are similar across a set of variables. Data example:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str3 name float(var1 var2 var3) "Yes" 888 888 888 "Yes" 2 1 2 "Yes" 2 1 2 "Yes" 4 4 4 "Yes" 0 1 1 "Yes" 0 1 1 "Yes" 1 . 1 "Yes" 0 1 1 "Yes" 0 0 0 "Yes" 0 . 1 "Yes" 0 0 0 end
Code:
. assert var1 == var2 == var3 11 contradictions in 11 observations assertion is false r(9);
Code:
. assert (var1 == var2) & (var2 == var3) 7 contradictions in 11 observations assertion is false r(9);
Comment