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: How to sort other variables by numeric variable


From   Nikitha Murali <nmurali@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to sort other variables by numeric variable
Date   Sun, 27 May 2012 13:27:34 -0500

This makes a lot of sense. Thank you for your help, Maarten!

Apologies for the breach of privacy, it will not happen again.

-Niki

On Sun, May 27, 2012 at 12:58 PM, Maarten Buis <maartenlbuis@gmail.com> wrote:
> It is convention on the statalist to respond on list and not
> privately. The reasons for that are discussed in the Statalist FAQ.
> <http://www.stata.com/support/faqs/res/statalist.html#private>
>
> -c(mean wage)- is an option of -table, so to see what it does you type
> in Stata -help table-
> The -bys:- prefix is discussed in -help by-.
>
> Did you run the example I gave you? If you did you would have seen
> what these things do... See:
> <http://www.maartenbuis.nl/example_faq/index.html#work>
>
> -- Maarten
>
>
> On Sun, May 27, 2012 at 7:05 PM, Nikitha Murali <nmurali@uchicago.edu> wrote:
>> Hello,
>>
>> Thanks for your reply.
>>
>> I understand that the 'married' variable corresponds to my own sex variable.
>> However, can you explain:
>> - what the c(mean wage) does
>> - what bys married: sum wage does
>>
>> Thank you.
>>
>>
>> On Sun, May 27, 2012 at 11:23 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:
>>> On Sun, May 27, 2012 at 5:59 PM, Nikitha Murali wrote:
>>>> I have a variable called sex that currently shows Male as 1  and
>>>> Female as 0. I have a number of other unrelated variables such as GPA.
>>>> I would like to get descriptive statistics of these variables for each
>>>> sex (i.e. compare the mean GPA of males against the mean GPA of
>>>> females.)
>>>
>>> There are a couple of ways of doing that:
>>>
>>> *--------- begin example ------------
>>> sysuse nlsw88, clear
>>>
>>> table married, c(mean wage)
>>> bys married: sum wage
>>> reg wage ibn.married, nocons hascons
>>> *---------- end example -------------
>>> (For more on examples I sent to the Statalist see:
>>> http://www.maartenbuis.nl/example_faq )
>>>
>>> The last option was discussed in a recent Stata tip:
>>> M.L. Buis (2012) "Stata tip 106: With or without reference", The Stata
>>> Journal, 12(1), pp. 162-164.
>>>
>>> Hope this helps,
>>> Maarten
>>>
>>> --------------------------
>>> Maarten L. Buis
>>> Institut fuer Soziologie
>>> Universitaet Tuebingen
>>> Wilhelmstrasse 36
>>> 72074 Tuebingen
>>> Germany
>>>
>>>
>>> http://www.maartenbuis.nl
>>> --------------------------
>>>
>>> *
>>> *   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/
>
>
>
> --
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
>
> http://www.maartenbuis.nl
> --------------------------
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index