Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65565

Using assert with missing observations

$
0
0
Dear all

Suppose i have a dataset with 5 variables. var1 and var2 have 100 observations while var3, var4 and var5 look like this:

Code:
var3  var4   var5
54     12      .
56     15    167
89     17    190
34     18    198
.      .       .
.      .       .
.      .       .
.      .       .
I am trying to use assert to see if a condition is satisfied but i do not get the desired result. I have tried with both !missing() and without:

Code:
assert var4 < var4[_n+1] & var5 > var5[_n+1]

assert var4 < !mi(var4[_n+1]) & !mi(var5) > !mi(var5[_n+1])
The assertion ought to be true but i suspect the missing values are interfering.

How can i get the right answer in the above example?

Viewing all articles
Browse latest Browse all 65565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>