Maybe this function already exists and I am not aware. I would love to save a mata matrix in something like r() or e(). It could be something like m() and would be protected in a similar way as r() and e(). I use more often mata for my Stata programs and I would like to give the user the option to access mata matrices in a similar fashion than r() or e(). My concern so far is that I accidentally overwrite a mata matrix from either another program or the user.
My work around so far is to call the mata matrix program specific. For example I have a mata program estimating using OLS called mataOLS, then the resulting vector of coefficients would be named mataOLS_b. It would be nicer if it would exits in something like m(b).
Why do I not transform the matrix into Stata and save it in e() or r()? For large datasets Stata matrices are slow and there are restrictions which do not exist in mata. Also sometimes I pick up mataOLS_b by another (mata) program and do not want to transform matrices back and forth.
-
Login or Register
- Log in with
Leave a comment: