# Matrix rownames from variable levelsof

#### jfca283

##### Member
Hello,
I'm writing a code and I need to name the matrix row names with the local created from levelsof applied to var1 (variable 1).
I already created the matrix using as reference a local (levels) using levelsof length.

I tried something simple as this
Code:
matrix rownames=levels'
Stata returned this
Code:
type mismatch
However, I can display the local values with
Code:
dis levels'
0101 1005 2006 3008 4010 4132 4565 5567
I need to clarify that the values from levels' are not numeric, they are strings.
Thanks for your help and time.

Last edited:

#### bukharin

##### RoboStataRaptor
You need to say the name of the macro to which you're adding names, eg:
Code:
matrix rownames A=levels'