I have a list that has about 50 elements, each repeated many times (a  
list of states by observation).  I want to create a vector with the  
same length with the same value repeated over and over again within  
states.  The value I want is the number of observations that are in  
the same state as each observation.
In stata, this is simply egen statesum = count(state), by(state).
What is the r equivalent?  tapply just gives me 50 observations.  No  
luck yet trying apply, lapply, etc.
Thomas Davidoff
Assistant Professor
Haas School of Business
UC Berkeley
Berkeley, CA 94720
phone:     (510) 643-1425
fax:        (510) 643-7357
davidoff@haas.berkeley.edu
http://faculty.haas.berkeley.edu/davidoff


	[[alternative HTML version deleted]]


