[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: counting
On Feb 7, 2004, at 2:33 AM, Amit wrote:
Suppose I have 5 states and I want to count the number of children in
tabstat child, stat(N) by(state)
state. How can I do this without generating a new variable. If I do
by state: count if child==1
then r(N) only stores the last state's result.
Not knowing more about your data, I don't know if this will actually do
what you want. But some variation on it should. For instance, if your
observations are on counties that are part of states, and each county
has a variable recording the number of school-age children, then
aggregating to the state level would be done with stat(sum). If you
Read The Fine Manual (or even the on-line help) you may find it quite
useful in this regard.
* For searches and help try: