Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: BASIC QUESTION - counts of counts

From   "Ben Hoen" <>
To   <>
Subject   st: BASIC QUESTION - counts of counts
Date   Fri, 22 Jul 2011 14:59:12 -0400

Can someone help me to produce a table that counts the number of unique
occurrences of a group inside another group?

For example assume I had the following table:

Number 	State	County
1		NY	Madison
2		NY	Madison
3		PA	Somerset
4		NY	Oneida		
5		PA	Somerset
6		PA	Wayne
7		PA	Luzerne

I want to produce a table like this:
State	County
NY	2
PA	3

Any ideas?


Ben Hoen
Principal Research Associate
Lawrence Berkeley National Laboratory
Office: 845-758-1896
Cell: 718-812-7589

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index