Great,
Many thanks!
On 11/26/07, Brian Fryd <[email protected]> wrote:
> try
> -bysort xy: gen z = _N -
>
> hope this helps
>
>
> On Nov 26, 2007 2:04 PM, mai mai <[email protected]> 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/