Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Counting interactions within a group


From   "mai mai" <mai7777@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Counting interactions within a group
Date   Mon, 26 Nov 2007 14:14:24 -0500

Great,
Many thanks!

On 11/26/07, Brian Fryd <brian.fryd@gmail.com> wrote:
> try
> -bysort xy: gen z = _N -
>
> hope this helps
>
>
> On Nov 26, 2007 2:04 PM, mai mai <mai7777@gmail.com> wrote:
> > Hi,
> > I have the following data, I want to count the number of times x
> > interacts with a specific y within each id, I want to create z:
> > id    x    y   z
> > s     1    1   1
> > s     1    3   2
> > s     1    3   2
> > s     1    4   1
> > s     2   1    2
> > s     2   1    2
> > s     2   3    1
> > s     2   4    1
> > f     1    1    1
> > f     1    2    2
> > f    1    2     2
> > f..........
> >
> >
> > Many thanks
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> >
>
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index