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: command stata


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: command stata
Date   Thu, 25 Aug 2011 21:32:33 -0400

> Donsaane 

This is a good opportunity for you to learn how to use Stata's -help-.  Type "help egen" and go down the page till you find group.  You will see it shows "group(varlist)" with a link from "varlist".  Go to the link and you will see  examples of what a "varlist" should look like. 

When you have a question about a command in Stata, always try the -help- first. There are always examples at the bottom of the page.  If you don't find what you need or don't understand something, be sure to say what -help- topics you've looked at when you write to Statalist. An alternative command to -help- if you don't know the command name is to search for your topic (under the Help Menu).  If you are connected to the internet, check "Search All" for the widest search.

Steve

On Aug 25, 2011, at 9:09 PM, Donsaane Dontsi Saatena wrote:

Thanks Richard.

That is if I understand I can do : egen infrastructures = group (roads, water, electricity)?




Richard Williams <[email protected]> a écrit&nbsp;:

> At 06:51 PM 8/25/2011, Donsaane Dontsi Saatena wrote:
>> Hi,
>> 
>> I am looking for stata's command in order to group many variables into
>> one. Let's say we have: roads, water , electricity, and we want to
>> group them into one variable: infrastructures.
>> could someone help me with the command?
>> 
>> thanks
> 
> Does -egen- with the group function do what you want? e.g.
> 
> . webuse nhanes2f, clear
> . egen grp = group(sex race), label
> . tab1 grp
> 
> -> tabulation of grp
> 
>   group(sex |
>       race) |      Freq.     Percent        Cum.
> -------------+-----------------------------------
>  Male White |      4,306       41.66       41.66
>  Male Black |        500        4.84       46.49
>  Male Other |        103        1.00       47.49
> Female White |      4,745       45.90       93.39
> Female Black |        586        5.67       99.06
> Female Other |         97        0.94      100.00
> -------------+-----------------------------------
>       Total |     10,337      100.00
> 
> 
> 
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME:   (574)289-5227
> EMAIL:  [email protected]
> WWW:    http://www.nd.edu/~rwilliam
> 
> *
> *   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/
> 
> 



Donsaane

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