I am trying to locate an element of a matrix and extract its row index with selectindex function. However, when the selectindex is empty, I cannot figure out how to evaluate that condition. See the following example:
my question is how can I write and IF condition that see whether row is empty or not.
Code:
mata y=2004::2010 y[3,1]=. y row=selectindex(y[.,1]:==2007) row!=0 row=selectindex(y[.,1]:==2006) // now row is niether zero or empty and I cannot find a way to evaluate if condition based on the value of row. see row!=0 row!=. row!=""
Comment