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: Combining multiple numeric variables


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Combining multiple numeric variables
Date   Sat, 8 Feb 2014 00:07:01 +0000

Look at the help for -egen-. It has various functions that combine
information across observations, e.g. -anycount()-.

For a more general review, see

SJ-9-1  pr0046  . . . . . . . . . . . . . . . . . . .  Speaking Stata: Rowwise
        (help rowsort, rowranks if installed) . . . . . . . . . . .  N. J. Cox
        Q1/09   SJ 9(1):137--157
        shows how to exploit functions, egen functions, and Mata
        for working rowwise; rowsort and rowranks are introduced

http://www.stata-journal.com/sjpdf.html?articlenum=pr0046

Nick
[email protected]


On 8 February 2014 00:01, Raquel Teixeira <[email protected]> wrote:
> Hi Everyone,
>
> It's my first post.
> Forgive me, I am a novice user and need some help combining numeric
> variables into 1 variable.
>
> Basically, it looks something like this
>
> ID      var1    var2    var3    var4
> 1       2       3       4       5
> 2       1       2
> 3       1
> 4       3       5       3
> 5       5
> 6       1
>
> Basically I am analyzing a survey where people picked multiple answers to
> one question, separated by commas. I separated the values in excel but now
> it's multiple columns and therefore multiple variables in stata. I need
> these values to be reflected under one main variable...so for instance I
> want to see how many people checked off 5, and want all 3 under one variable
> and yet still attached to its ID variable - I hope I am being clear and if
> you have any advice on  how to combine these variables into one that
> reflects all 4 variable values.
>
> Thank you!!
> Raquel Teixeira
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index