The data structure is:
State | County | Date | AQI | Pollutant |
---|---|---|---|---|
Alabama | Baldwin | 5/2/2017 | 68 | ozone |
Alabama | Baldwin | 6/4/2017 | 102 | PM2.5 |
Alabama | Dekalb | 6/6/2017 | 105 | PM10 |
I am trying to count days/year where AQI is >100, by pollutant, county, and state, such that the output looks like:
State | County | ozone | PM2.5 | PM10 |
---|---|---|---|---|
Alabama | Baldwin | |||
Alabama | Dekalb |
Where the table values represent the # of days/year with AQI>100 for that state and county, by each pollutant. Each state and county combination should only appear once per row.
Is there a straightforward way to do this in SAS without subsetting the data? I have tried some combinations of proc sql and proc report, but can't produce what I'm looking for. ALSO, is there a way to evaluate if there are multiple pollutants with AQI>100 on the same date for the same county and state? For example, in the first table above, if there was an observation for Alabama, Baldwin, 6/4/2017, 107, ozone.