Some community-contributed commands like xtoverid do not return a matrix of results similar to xtreg but sets of scalars, but I want to return them in a matrix with their names for easier referencing in a matrix after I have run a command and give the matrix a simple name. I know how to extract the scalars manually from this post OR how to automatically extract the names of the scalar from this post.
Desired result would be a matrix like this, where the name of the matrix would be "hausmantest":
stat
j -294.19553
jp 55.691719
jdf -5.2825724
Code:
use https://www.stata-press.com/data/r18/union.dta, clear xtset idcode year xtreg union age black xtoverid * Matrix with the results matrix A = r(j) \r(jdf) \ r(jp) * Extract the scalar names local haus: r(scalars)
stat
j -294.19553
jp 55.691719
jdf -5.2825724
Comment