Hi all
I am new to Mata. Wondering what would be the Mata way (the fastest I suppose) of doing the following 'replace':
Grateful for your help.
I am new to Mata. Wondering what would be the Mata way (the fastest I suppose) of doing the following 'replace':
Code:
clear set obs 10 g a=1 g b=1 g c=1 g d=1 g e=1 g id=1 if _n>5 foreach var of varlist a-e{ replace `var'=. if id==1 }
Grateful for your help.
Comment