Dear all.
I'm trying to make subset dataset in mata space but I could not find any help about it.
for example..
If I have a list of variables of (year x1 x2 x3) and I would like to make subset matrix by "year".
So if year==1990, I would like to make matrix "mat" with all the variables which is in 1990.
mata:
st_view(xx=.,.,("year","x1",x2","x3"))
if (xx[.,1]==1990) {
mat=xx[.,.]
}
The code presented above doesn't work.
Does anybody can help me??
Thanks a lot.
I'm trying to make subset dataset in mata space but I could not find any help about it.
for example..
If I have a list of variables of (year x1 x2 x3) and I would like to make subset matrix by "year".
So if year==1990, I would like to make matrix "mat" with all the variables which is in 1990.
mata:
st_view(xx=.,.,("year","x1",x2","x3"))
if (xx[.,1]==1990) {
mat=xx[.,.]
}
The code presented above doesn't work.
Does anybody can help me??
Thanks a lot.
Comment