The documentation says that uniqrows() works with transmorphic matrix P. However, uniqrows(P,1) produces an error when P is a string matrix. For example:
The source of the error is obvious from the source code (view uniqrows.mata, adopath asis ). The last line will produce an error if res is a string matrix and count is a real matrix.
Is there a way to calculate the frequencies for string matrices?
Code:
sysuse surface, clear mata: P = st_sdata(.,"date",.) uniqrows(P, 0) uniqrows(P, 1) end
Code:
if (freq) res = res,count
Comment