I am using the follow loop to return the last non missing observation :
However this is really slow when doing it in large datasets, anyway to replicate this in mata?
P.S My knowledge of mata is near zero.
Thanks in advance.
Code:
foreach var of varlist _all { local N = _N while missing(`var'[`N']) { local N = `N' - 1 } }
P.S My knowledge of mata is near zero.
Thanks in advance.
Comment