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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Need help with transforming dataset, please


From   William Buchanan <william@williambuchanan.net>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Need help with transforming dataset, please
Date   Mon, 25 Feb 2013 20:41:30 -0800

Sorry about that.  I didn't look at things carefully enough before responding.


Sent from my iPhone

On Feb 25, 2013, at 16:35, Nick Cox <njcoxstata@gmail.com> wrote:

> Not so. For example, the first Subject variable contains
> 
> MATH
> ENGLISH
> FRENCH
> GEOG
> 
> On Tue, Feb 26, 2013 at 12:30 AM, William Buchanan
> <william@williambuchanan.net> wrote:
> 
>> -help rename- is all that you need.
> 
> On Feb 25, 2013, at 16:18, Bidemi Carrol <bidemi@gmail.com> wrote:
> 
>>> I would appreciate some help with transforming the dataset below.
>>> Reshape does not seem to work, but I may be applying it wrong.
>>> 
>>> The original dataset is as follows (with many more grade and subject
>>> combinations):
>>> 
>>> StudId Gender  Subject1 Grade1 Subject2  Grade2   Subject3  Grade3
>>> Subject4  Grade4
>>> 121    F           MATH       3        ENGLISH  4           GEOG     5
>>>       FRENCH  5
>>> 122    F           ENGLISH  4        GEOG      5           MATH      5
>>> 123    M          FRENCH   2        ENGLISH  3           MATH      1
>>>      GEOG      3
>>> 124    M          GEOG       1        MATH       2          ENGLISH  2
>>> 
>>> I would like it to look like this:
>>> 
>>> StudID  Gender  Math  English  French  Geog
>>> 121        F          3         4             5        5
>>> 122        F          5         4                       5
>>> 123        M         1         3             2         3
>>> 124        M          2        2                        1
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index