Evidently, -tabstat- (official Stata)
includes code to cope with labels like this.
-tabstatmat- (SSC) tries to do just one thing,
take -tabstat-'s r-class results and produce
a matrix. But it cannot overcome Stata's
inbuilt reluctance to use text from labels
like this as matrix row or column names.
Stata 8.2 being part of history, there will certainly
be no fixes or upgrades to take care of this problem
as far as official matrices are concerned. In principle,
that might be done in Stata 9 up.
I wrote -tabstatmat-, inspired by a problem
you suggested. I guess that it could be modified
to use values whenever the labels are not
acceptable, but at this moment it doesn't seem
worth the time.
Feel free to take over the program.
Nick
[email protected]
Friedrich Huebler
> I have Stata 8.2. Is it possible to create a matrix row name that
> contains a period? [U] 17.2 on matrix row and column names indicates
> that a row name can contain a period when it has the form
> ts_operator.subname. I encountered this problem when I tried
> -tabstatmat- (available at SSC) with a variable whose labels indicate
> ranges like "0 to 9.9" or "10 to 19.9".
>
> . sysuse auto, clear
> . lab def foreign 0 "0 to 9.9"
> . lab val foreign foreign
> . tabstat mpg, by(foreign) save
> . set trace on
> . tabstatmat mat
>
> = matrix rownames mat = `"0 to 9.9"' `"1"' Total
> 0to9: operator invalid
> ------------------------------ end tabstatmat ---
> r(198);
>
> Can -matrix rownames- accept a period and is it then possible to
> change tabstatmat.ado accordingly?
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/