Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: -tabstatmat- and matrix row name with period


From   [email protected]
To   [email protected]
Subject   Re: st: RE: -tabstatmat- and matrix row name with period
Date   Mon, 11 Jul 2005 13:51:51 -0400

Hi,

I have a program, quite similar to Nick's but which
also solves the labels problems. I do the following:
- remove the problematic character in the labels if any (ex: "0 to 9.9" would in
this case become "0to99"). I choose this to make labels still readable.
- use the name plus the number in case there is no label (ex: X_1 X_2 X_3 if X
has no labels but only 1 2 3 as modalities).

The user has the option to specify which characters to remove from the labels.

It's been tested by many people and so far, all the bugs have been fixed and it
is working fine.

Best regards.

Amadou Bassirou Diallo.




                                                                                                                                               
                      "Nick Cox"                                                                                                               
                      <[email protected]>           To:       <[email protected]>                                              
                      Sent by:                         cc:                                                                                     
                      owner-statalist@hsphsun2.        Subject:  st: RE: -tabstatmat- and matrix row name with period                          
                      harvard.edu                                                                                                              
                                                                                                                                               
                                                                                                                                               
                      07/11/2005 01:36 PM                                                                                                      
                      Please respond to                                                                                                        
                      statalist                                                                                                                
                                                                                                                                               
                                                                                                                                               
                                                                                                                                               




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/



*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index