Consider the following matrix of strings.
I sometimes use the st_matrix command to make a Stata matrix from a Mata matrix like below:
However, according to the manual of Mata, st_matrix works only for a real matrix.
So, I have checked whether the st_local command is available, but, you know, the st_local command is for a scalar.
How can I make a Stata matrix from a string matrix from Mata?
Code:
. mata: A = ("one", "two")
Code:
. mata: B = (1, 2) . mata: st_matrix("B", B) . matrix list B
Code:
. mata: st_matrix("A", A) st_matrix(): 3253 nonreal found where real required <istmt>: - function returned error
How can I make a Stata matrix from a string matrix from Mata?
Comment