Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: AW: st: AW: tabm with %'s


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: AW: st: AW: tabm with %'s
Date   Thu, 29 Oct 2009 14:08:11 +0100

<> 



" I don't know why -findit- didn't work for Eric, because it does for me.
It finds some false positives such as -tabmerge-, but that's a known
risk."


In this sense, it does indeed work. Somehow I thought that -tabm- should be
more obviously highlighted in those results, but with the benefit of
hindsight, it was possible to -findit-. Anyway, as Nick points out, the onus
is on the initial poster to provide this reference "for free"...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox
Gesendet: Donnerstag, 29. Oktober 2009 14:04
An: statalist@hsphsun2.harvard.edu
Betreff: RE: AW: st: AW: tabm with %'s

As Martin points out, list members are asked to spell out where
user-written software they refer to comes from. This is not a silly
little rule, but advice based on promoting everyone's best interests: 

1. People who might answer have a clearer sense of the precise problem. 

2. People interested in the general topic might learn about something of
use or interest to them. 

3. Software writers might be helped to recognise their own children. 

4. Questioners increase their chance of a quick, correct and complete
solution of their problem. 

Really, no one loses. And anyone who thinks that the request to provide
clear and complete questions is out of order should hire consultants and
reach for their credit cards.  

I don't know why -findit- didn't work for Eric, because it does for me.
It finds some false positives such as -tabmerge-, but that's a known
risk.

-tabm- is indeed a part of -tab_chi- The latest public version of
-tab_chi- is on SSC. An earlier version is on the StataCorp website. 

Now to the question: As Eric states, and contrary to Beth's statement,
-tabm- does support percent calculations. As the help indicates, you can
specify -tabulate- options, and so you can get row, column or cell
percents. 

Here is another dopey example:

. set obs 10
obs was 0, now 10

. forval i = 1/5 {
  2. gen foo`i' = round(rnormal())
  3. }

. tabm foo*, trans col

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |                        Variable
    Values |      foo1       foo2       foo3       foo4       foo5 |
Total
-----------+-------------------------------------------------------+----
------
        -2 |         2          1          0          0          0 |
3 
           |     20.00      10.00       0.00       0.00       0.00 |
6.00 
-----------+-------------------------------------------------------+----
------
        -1 |         0          3          4          2          2 |
11 
           |      0.00      30.00      40.00      20.00      20.00 |
22.00 
-----------+-------------------------------------------------------+----
------
         0 |         5          3          2          5          4 |
19 
           |     50.00      30.00      20.00      50.00      40.00 |
38.00 
-----------+-------------------------------------------------------+----
------
         1 |         1          3          3          3          3 |
13 
           |     10.00      30.00      30.00      30.00      30.00 |
26.00 
-----------+-------------------------------------------------------+----
------
         2 |         2          0          1          0          1 |
4 
           |     20.00       0.00      10.00       0.00      10.00 |
8.00 
-----------+-------------------------------------------------------+----
------
     Total |        10         10         10         10         10 |
50 
           |    100.00     100.00     100.00     100.00     100.00 |
100.00

If Beth needs something else, then she should please specify what that
is. 

Nick 
n.j.cox@durham.ac.uk 

Eric Booth

Hmm....at second glance, looks like its a part of -tab_chi-.

On Oct 29, 2009, at 7:02 AM, Martin Weiss wrote:

> " but it does if I type -help tabm-"
>
>
> Not even that helps in my case (why would -findit- not find it, but - 
> help-
> does?). Just to be sure: Where is this command from?

Eric Booth

> -tabm- does a tabulation of multiple variables.  It doesn't show up
> for me either when I type -findit tabm- , but it does if I type -help
> tabm- (so, tabm is not an abbreviation of one of the six items that
> comes up in Martin's -findit- search).
>
>
> The help file indicates that -tabm- uses options from -tabulate-, so
> you can display percentages rather than frequencies with something  
> like:
>
> *****
> clear
> sysuse auto
> tabm for rep78, cell nofreq
>
> **or all the %**
>
> tabm for rep78, cell row col nofreq
> ******

On Oct 29, 2009, at 3:14 AM, Martin Weiss wrote:

>> What is -tabm-? Note you are supposed to tell the list where your
>> user-written stuff comes from. In this case, -findit tabm- throws up
>> six
>> different possibilities...

Beth Gifford

>> Is there any way to get the same output as tabm but with percents
>> rather than counts?
>>
>> I am compiling many tables from surveys that had matrices with likert
>> scales.  Example, rate how much you agree with each of the following
>> items on a strongly agree to strongly disagree scale.  It would save
>> me some time if there was a routine almost exactly like tabm but that
>> produced %'s rather than counts.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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