IN R counting hierarchical data

Posted by Alison on Stack Overflow See other posts from Stack Overflow or by Alison
Published on 2010-06-18T15:59:47Z Indexed on 2010/06/18 16:03 UTC
Read the original article Hit count: 301

Filed under:
|
|

I have a list of counties in each state that received nonattainment status in years 1995-2005.

I want to know how many counties in each state each year that received this status.

If my data is formatted like this,

State1 Country1 YR1 Yr2 Yr3 Yr4... State1 Country2 YR1 Yr2 Yr3 Yr4 State2 County1 Yr1 Yr2.....

Each year variable could have a 1 or a zero, since a county may gain or loose this status in a time period.

I need to count each year how many counties in each state have nonattainment status (YRx=1), but can't think of how to do it.

© Stack Overflow or respective owner

Related posts about r

    Related posts about count