Hello, forum users.
I'm trying to data cleaning as follow
mata
K1995T[N02,N01] = rowsum(K1995T[N02,1::N]);
K1995T[N03,N01] = rowsum(K1995T[N03,1::N]);
K1996T[N02,N01] = rowsum(K1995T[N02,1::N]);
K1996T[N03,N01] = rowsum(K1995T[N03,1::N]);
.
.
.
K2010T[N02,N01] = rowsum(K2010T[N02,1::N]);
K2010T[N03,N01] = rowsum(K2010T[N03,1::N]);
How can I make it shorter to use loop?
I'm trying to data cleaning as follow
mata
K1995T[N02,N01] = rowsum(K1995T[N02,1::N]);
K1995T[N03,N01] = rowsum(K1995T[N03,1::N]);
K1996T[N02,N01] = rowsum(K1995T[N02,1::N]);
K1996T[N03,N01] = rowsum(K1995T[N03,1::N]);
.
.
.
K2010T[N02,N01] = rowsum(K2010T[N02,1::N]);
K2010T[N03,N01] = rowsum(K2010T[N03,1::N]);
How can I make it shorter to use loop?
Comment