Hi,
I need to estimate fraud at county level.
Fraud variables:
- Fraud_this_year
- Past_fraud
- Next_year_fraud
County level variable PrimaryOfficialCountyCode
What I need to do is to estimate Fraud at county level.
If we look to Arapahoe (PrimaryOfficialCountyName, column 4) we have multiple observation at city and county level for each year for each of the three fraud variables.

Therefore, what I am looking for is to determine how many Fraud_this_year, Past_fraud and Next_year_fraud I have each year at county level (PrimaryOfficialCountyCode)
Thus I would expect something like that:
If I run this it does not give me the result that I want.
collapse (count) num_this_year_fraud=Fraud_this_year num_past_fraud=Past_fraud num_next_year_fraud=Next_year_fraud, by (year PrimaryOfficialCountyCode PrimaryOfficialCountyName)
Can I kindly ask your help?
Thanks a lot.
Giulia
I need to estimate fraud at county level.
Fraud variables:
- Fraud_this_year
- Past_fraud
- Next_year_fraud
County level variable PrimaryOfficialCountyCode
What I need to do is to estimate Fraud at county level.
If we look to Arapahoe (PrimaryOfficialCountyName, column 4) we have multiple observation at city and county level for each year for each of the three fraud variables.
Therefore, what I am looking for is to determine how many Fraud_this_year, Past_fraud and Next_year_fraud I have each year at county level (PrimaryOfficialCountyCode)
Thus I would expect something like that:
PrimaryOfficialCountyCode | year | Fraud this year | Past fraud | Next year fraud |
8005 | 2011 | 1 | 1 | 1 |
8005 | 2012 | 1 | 1 | 1 |
8005 | 2013 | 1 | 1 | 1 |
8005 | 2014 | 1 | 1 | 0 |
8005 | 2015 | 0 | 1 | 0 |
collapse (count) num_this_year_fraud=Fraud_this_year num_past_fraud=Past_fraud num_next_year_fraud=Next_year_fraud, by (year PrimaryOfficialCountyCode PrimaryOfficialCountyName)
Can I kindly ask your help?
Thanks a lot.
Giulia
Comment