Is there a way to find the mode of a variable within a specified window of time using the rangestat command?
I've never written a function in Mata before and after reading a few threads on this topic, I came up with this
The programme returns error 3499, "function not found". How do you specify mode in Mata? I tried searching in Mata manual, but the word 'mode' is used in a different sense there.
I've never written a function in Mata before and after reading a few threads on this topic, I came up with this
Code:
mata: real rowvector mode(real matrix X) { return(mode(X), max) } end rangestat (mode) my_var, interval(time -10 10)
Comment