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   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: How to sort other variables by numeric variable
Date   Sun, 27 May 2012 18:23:38 +0200

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/


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