@rows of a series without NA ou zero
Posted: Thu Nov 30, 2017 1:48 pm
Hi, I would like to count the number of non zero rows in a series.
I have first initiate zero value of the series,
smpl 1970w1 @now
series signal = 0
and then based upon certain rule, I have assigned value of -1, -05, 0, 0.5 and I to the series.
I was able to calculate the size of my sample by @rows( signal) which is 2500.
Now I would like to count the number of 0 in the series
I tired this method but in vain.
if signal <> 0 then
scalar count_nonzero = @rows( signal)
end if
Thanks for the help.
I have first initiate zero value of the series,
smpl 1970w1 @now
series signal = 0
and then based upon certain rule, I have assigned value of -1, -05, 0, 0.5 and I to the series.
I was able to calculate the size of my sample by @rows( signal) which is 2500.
Now I would like to count the number of 0 in the series
I tired this method but in vain.
if signal <> 0 then
scalar count_nonzero = @rows( signal)
end if
Thanks for the help.