Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: Combing Variables


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Combing Variables
Date   Wed, 27 Apr 2011 18:49:34 +0100

Depends on what you mean by "combine". 

Perhaps in your field that has some precise meaning, but not in mine! 

But -egen, max()- would be useless here as it seems you want to combine across observations, in which case it would be a matter of one of the -row*()- functions of -egen-. 

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

Dennis Kramer

I have the following dataset:

Student_ID     Subject Code     Test1 Year 1     Test1 Year 2     Test
1 Year 3     Test 2 Year1      Test 2 Year 2     Test 2 Year 3
    1                   1                        50

 45                    42
    1                   2                        65

 50                    42
    2                  1                         50
   49
                       42
    2                   2                        65
   50
                       42

I wanted to generate a variables for each year that combines the test
types. I am not sure if I could use the egen max function.


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