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: Alternative to -collapse-?


From   Stas Kolenikov <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Alternative to -collapse-?
Date   Tue, 23 Jul 2013 08:17:22 -0500

How much of the -by- operations are you familiar with? If not much,
start off with http://www.stata-journal.com/article.html?article=pr0004
and see if that helps.

-- Stas Kolenikov, PhD, PStat (ASA, SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name



On Tue, Jul 23, 2013 at 8:10 AM, Lukas Borkowski <[email protected]> wrote:
> Dear list,
>
> I am using Stata 12 and currently clean up a dataset that will become a panel dataset. The quality of the dataset is quite poor (originates from a survey) and I face multiple (endless) situations where values to the same questions are recorded in different variables. The tricky situations that I need to sum these values across rows and columns on a household level. The structure looks somewhat like this simplified example:
>
> id      v1      v2      v3
> 1       .       .       2
> 1       .       7       .
> 1       9       .       .
> 2       4       .       1
> 2       .       7       .
> 2       7       .       .
> ...
>
> I would like to generate a variable v4 that sums v3 on a household level. I currently use -collapse (sum) v3, by(id)- but this is obviously a real pain as I would have to merge all the resulting micro datasets.
>
> Do you have any suggestion what I could do?
>
> Thank you very much for your help!
>
> Best,
>
> Lukas
>
> #
> Lukas Borkowski
> University of London, School of Oriental and African Studies (SOAS)
>
>
>
>
>
> *
> *   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