Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: summary tables for categorical variables


From   Donald Spady <[email protected]>
To   Statalist Statalist <[email protected]>
Subject   Re: st: summary tables for categorical variables
Date   Tue, 11 Feb 2014 18:59:04 -0700

Nick
  Yes.  I found that also and it seems to be just what I want.
Many thanks for all your help.
DOn
On Feb 11, 2014, at 5:26 PM, Nick Cox <[email protected]> wrote:

> I don't know what -tabw- is, but I didn't recommend it.
> 
> -tabm- from -tab_chi- offers the options of -tabulate-. The help explains:
> 
> tabulate_options are options allowed with tabulate varname1 varname2.
> 
> Consider
> 
> set obs 100
> forval j = 1/9 {
>     gen y`j' = ceil(10 * runiform())
> }
> tabm y*, row
> tabm y*, col
> 
> Nick
> [email protected]
> 
> On 11 February 2014 22:58, Donald Spady <[email protected]> wrote:
> 
>> Nick. Thanks for the fast response.  Your suggestion of mrtab is close, but not quite what I need.  mrtab puts the variables down the left side of the table, but only gives a summary of the frequency of the responses.  I want to have (for e.g. 6 columns: 1 for the variable name and 5 for the possible responses (e.g. SA A N D SD).  I dont see any option within mrtab to do that.
>>  I looked at tabw which is much closer to what is needed, but it does not give the option of say percentage rather than frequency. I know that is nitpicking, but Stata is so extensible I wonder if anyone has looked at this.
> 
> On Feb 11, 2014, at 1:40 PM, Nick Cox <[email protected]> wrote:
> 
>>> Sounds like
>>> 
>>> -mrtab- (SJ)
>>> 
>>> -tabm- (-tab_chi- on SSC)
> 
> On 11 February 2014 20:23, Donald Spady <[email protected]> wrote:
> 
>>>> I want to create a table for categorical variables that is something like tabstat where the variable names are in a left hand column and, instead of statistics in the columns to the right, I want the contents of the categories that the variable contains.
>>>> For example
>>>> Varname "likeDon" SA:10, A:5, N:3, D:1 SD 2 Miss/NA: 2
>>>> varname "likeNick" SA:50, A;20, N:3, D:12, SD: 0 Miss/NA:4
>>>> varname "likeSue"  and so on
>>>> where SA A N D and SD are the possible responses.
>>>> 
>>>> Is there anything in Stata that can do this. If so, what and how?
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index