-
Notifications
You must be signed in to change notification settings - Fork 0
/
IRS-Business-Master-File.rmd
496 lines (422 loc) · 20 KB
/
IRS-Business-Master-File.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# The Business Master File with NTEE Codes
Information on the current IRS Exempt Organization Business Master Files can be found on the IRS website:
https://www.irs.gov/charities-non-profits/exempt-organizations-business-master-file-extract-eo-bmf
The script below parses the four separate regional files and combines them into a single Business Master File of all current Exempt Organizations including useful information about the organizational type, activities, and finances. Note that this is only current organizations, and not a cumulative database. This file contains approximately 1.5 million organizations.
The IRS also provides a list of all Exempt Organizations [HERE](https://github.com/lecy/Open-Data-for-Nonprofit-Research/blob/master/Build_Datasets/current%20master%20exempt%20list.Rmd), but this file includes a limited number of variables.
![alt text](https://github.com/lecy/Open-Data-for-Nonprofit-Research/blob/master/Resources/ruledates.png)
<br/>
<br/>
## DOCUMENTATION
The full documentation, including defitions of all category codes, is available here: https://www.irs.gov/pub/irs-soi/eo_info.pdf
The Data Dictionary:
Variable Name | Definition
---------------|-------------
EIN | Employer Identification Number (EIN)
NAME | Primary Name of Organization
ICO | In Care of Name
STREET | Street Address
CITY | City
STATE | State
ZIP | Zip Code
GROUP | Group Exemption Number
SUBSECTION | Subsection Code
AFFILIATION | Affiliation Code
CLASSIFICATION | Classification Code(s)
RULING | Ruling Date
DEDUCTIBILITY | Deductibility Code
FOUNDATION | Foundation Code
ACTIVITY | Activity Codes
ORGANIZATION | Organization Code
STATUS | Exempt Organization Status Code
TAX_PERIOD | Tax Period
ASSET_CD | Asset Code
INCOME_CD | Income Code
FILING_REQ_CD | Filing Requirement Code
PF_FILING_REQ_CD | PF Filing Requirement Code
ACCT_PD | Accounting Period
ASSET_AMT | Asset Amount
INCOME_AMT | Income Amount (includes negative sign if amount is negative)
REVENUE_AMT | Form 990 Revenue Amount (includes negative sign if amount is negative)
NTEE_CD National | Taxonomy of Exempt Entities (NTEE) Code
SORT_NAME | Sort Name (Secondary Name Line)
<br/>
<br/>
## CREATE THE BUSINESS MASTER FILE
```r
# download all regions and combine into a single dataset
region.01 <- read.csv( "https://www.irs.gov/pub/irs-soi/eo1.csv" , stringsAsFactors=F )
region.02 <- read.csv( "https://www.irs.gov/pub/irs-soi/eo2.csv" , stringsAsFactors=F )
region.03 <- read.csv( "https://www.irs.gov/pub/irs-soi/eo3.csv" , stringsAsFactors=F )
region.04 <- read.csv( "https://www.irs.gov/pub/irs-soi/eo4.csv" , stringsAsFactors=F )
bmf <- rbind( region.01, region.02, region.03, region.04 )
# The rule date is formatted as YYYY-MM, so split out the year
bmf$RULEYEAR <- substr( bmf$RULING, 1, 4 )
# barplot of ruling dates
options( scipen=8 )
barplot( table( bmf$RULEYEAR ), las=2, cex.names=0.5, col="gray40", border=NA )
abline( h=seq(20000,100000,20000), col="white", lwd=2 )
title( main="Ruling Dates of Existing Nonprofits" )
# the NTEE codes created by the IRS are very messy with lots of errors
table( bmf$NTEE )
# create to top level group - see documentation below
bmf$LEVEL4 <- substr( bmf$NTEE_CD, 0, 1 )
# SEPARATE ACTIVITY CODES
#
# The variable ACTIVITIES consists of three separate 3-digit activity codes.
# Split these into separate variables.
# Documentation available below.
bmf$ACT1 <- substr( bmf$ACTIVITY, 1, 3 )
bmf$ACT2 <- substr( bmf$ACTIVITY, 4, 6 )
bmf$ACT3 <- substr( bmf$ACTIVITY, 7, 9 )
```
## WRITE DATA TO YOUR FAVORITE FORMAT
```R
# AS R DATA SET
saveRDS( bmf, file="BusinessMasterFile.rds" )
# AS CSV
write.csv( bmf, file="BusinessMasterFile.csv", row.names=F )
# IN STATA
install.packages( "haven" )
library( haven )
write_dta( bmf, file="BusinessMasterFile.dta" )
# IN SPSS - creates a text file and a script for reading it into SPSS
library( foreign )
write.foreign( df=bmf, datafile="BusinessMasterFile.txt", codefile="CodeToLoadDataInSPSS.txt", package="SPSS" )
```
<br/>
<br/>
## NTEE MAJOR GROUP CATEGORIES
The National Taxonomy of Exempt Organizations has 26 main groups, and many subgroups within those.
The major group categories, referred to as LEVEL4 in the script above (to stay consistent with older NCCS conventions and NCCS Business Master File data dictionaries), are as follows:
NTEE-CC Major Groups
Category | Definition
---------|---------------
A | Arts, Culture, and Humanities
B | Education
C | Environmental Quality, Protection, and Beautification
D | Animal-Related
E | Health
F | Mental Health, Crisis Intervention
G | Diseases, Disorders, Medical Disciplines
H | Medical Research
I | Crime, Legal Related
J | Employment, Job Related
K | Food, Agriculture, and Nutrition
L | Housing, Shelter
M | Public Safety
N | Recreation, Sports, Leisure, Athletics
O | Youth Development
P | Human Services - Multipurpose and Other
Q | International, Foreign Affairs, and National Security
R | Civil Rights, Social Action, Advocacy
S | Community Improvement, Capacity Building
T | Philanthropy, Voluntarism, and Grantmaking Foundations
U | Science and Technology Research Institutes, Services
V | Social Science Research Institutes, Services
W | Public, Society Benefit - Multipurpose and Other
X | Religion Related, Spiritual Development
Y | Mutual/Membership Benefit Organizations, Other
Z | Unknown
<br/>
<br/>
## ACTIVITY CODES
An organization formerly listed up to three activity codes on application Forms 1023 and 1024. These are codes which
reflect an organization's purposes, activities, operations, or type. From one to three activity codes may be in this field.
Note: activity codes became obsolete with the adoption of the National Taxonomy of Exempt Entity (NTEE) coding system
in January 1995. However, organizations determined to be exempt prior to that date will reflect the activity codes
previously assigned.
The final column in the table below represents the mapping of obsolete activity codes to current NTEE codes.
http://nccs.urban.org/classification/irsactivity.cfm
ACTIVITY CODE | DESCRIPTION | NTEE-CC
----------------|-----------------------|-----------------------------------
RELIGIOUS ACTIVITIES ||
001 | Church,synagogue, etc | X20 - X70
002 | Association or convention of churches | X03
003 | Religious order | X20 - X70
004 | Church auxiliary | X11 - X19
005 | Mission | X20 - X70
006 | Missionaryactivities | X20- X70
007 | Evangelism | X20
008 | Religious publishing activities | X83
029 | Other religious activities | X20 - X99
SCHOOLS, COLLEGES AND RELATED ACTIVITIES ||
030 | School, college, trade school, etc. | B20 - B60
031 | Special school for the blind, handicapped, etc | B28
032 | Nursery school; Note: Day care center (use 574) | B21
033 | Faculty group | B99
034 | Alumni association or group | B84
035 | Parent or parent-teachers association | B94
036 | Fraternity or sorority; Note: Key club (use 323) | B83
037 | Other student society or group | B80
038 | School or college athletic association | N40
039 | Scholarships for children of employees | B82
040 | Scholarships (other) | B82
041 | Student loans | B82, B90
042 | Student housing activities | B82, B90
043 | Other student aid | B80
044 | Student exchange with foreign country | Q22
045 | Student operated business) | O53
046 | Private school | B20 - B50
059 | 059Other school related activities | B80 - B99
CULTURAL, HISTORICAL OF OTHER EDUCATIONAL ACTIVITIES ||
060 | Museum, zoo, planetarium, etc. | A50 - A57, D50
061 | Library | B70
062 | Historical site, records or reenactment | A80, A84
063 | Monument | A80
064 | Commemorative event (centennial, festival, pageant, etc.) | A80, A84
065 | Fair | N52
088 | Community theatrical group | A65
089 | Singing society or group | A6B
090 | Cultural performances | A60 - A6E
091 | Art exhibit | A40, A51
092 | Literary activities | A70
093 | Cultural exchanges with foreign country | Q21
094 | Genealogical activities | A80
119 | Other cultural or historical activities | A20 - A26, A40 - A99
OTHER INSTRUCTIONS AND TRAINING ACTIVITIES ||
120 | Publishing activities | A33, X83
121 | Radio or television broadcasting | A32, A34, X82, X84
122 | Producing films | A31, X81
123 | Discussion groups, forums, panels lectures, etc. | A20 - A26, A40 - A99
124 | Study and research (non-scientific) | Common Code 05
125 | Giving information or opinion (see also Advocacy) | Common Code 02, 05
126 | Apprentice training; Note: Travel tours (use 299) | J22
149 | Other instruction and training | A25, A6E, J20-J30, B20-B60
HEALTH SERVICES AND RELATED ACTIVITIES ||
150 | Hospital | E20 - E24
151 | Hospital auxiliary | E112, E122
152 | Nursing or convalescent home | E91
153 | Care and housing for the aged (see also 382) | E91, P75, L22, K34, K36
154 | Health clinic | E30 - E32
155 | Rural medical facility | E30
156 | Blood bank | E61
157 | Cooperative hospital service organization | E192
158 | Rescue and emergency service | E62, M20, M23
159 | Nurses register or bureau | E039
160 | Aid to the handicapped (see also 031) | P80, P82, P86, P87, E50
161 | Scientific research (diseases) | H20 - H99
162 | Other medical research | H20 - H99, U50
163 | Health insurance (medical, dental, optical, etc.) | E80
164 | Prepared group health plan | E80
165 | Community health planning | E70
166 | Mental health care | F20 - F99
167 | Group medical practice association | E31
168 | In-faculty group practice association | E31
169 | Hospital pharmacy, parking facility, food services, etc. | E192
179 | Other health services | E20 - E99
SCIENTIFIC RESEARCH ACTIVITIES ||
180 | Contact or sponsored scientific research for industry | U20 - U99
181 | Scientific research for government | U20 - U99
182 | Other scientific research activities | U20 - U99
BUSINESS AND PROFESSIONAL ORGANIZATIONS ||
200 | Business promotion | S41
201 | Real estate association | S47
202 | Board of trade | S40
203 | Regulating business | S194
204 | Promotion of fair business practices | S40
205 | Professional association | Common Code 03
206 | Professional association auxiliary | Common Code 11
207 | Industry trade shows | S41
208 | Convention displays--_Testing products of public safety (use 905) | S40
209 | Research, development and testing | U20 - U99
210 | Professional athletic league | N80
211 | Underwriting municipal insurance | Y20 - Y25
212 | Assigned risk insurance activities | Y20 - Y25
213 | Tourist bureau | S30
229 | Other business or professional group | Common Code 03, S41
FARMING AND RELATED ACTIVITIES ||
230 | Farming | K20
231 | Farm bureau | K28
232 | Agricultural group | K20
233 | Horticultural group | C40
234 | Farmers cooperative marketing or purchasing | K20
235 | Financing crop operations | K11, K12
236 | Dairy herd improvement association | K26
237 | Breeders association | K26
249 | Other farming and related activities | K20 - K28, K99
MUTUAL ORGANIZATIONS ||
250 | Mutual ditch, irrigation, telephone, electric company | W50, W80, W99, Y22
251 | Credit union | W60
252 | Reserve funds or Insurance | Y20
253 | Mutual insurance company | Y23
254 | Corporation organized under an Act of Congress | W20
259 | Other mutual organization | Y20 - Y99
EMPLOYEE OF MEMBERSHIP BENEFIT ORGANIZATIONS ||
260 | Fraternal Beneficiary society, order, or association | Y40 - Y42
261 | Improvement of conditions of workers | J40
262 | Association of municipal employees | J40
263 | Association of employees | J40
264 | Employee or member welfare association | Y20 - Y40, Y99
265 | Sick, accident, death, or similar benefits | Y20 - Y40, Y99
266 | Strike benefits | Y24
267 | Unemployment benefits | Y24
268 | Pension or retirement benefits | Y30 - Y42
269 | Vacation benefits | Y99
279 | Other services or benefits to members or employees | Y20 - Y40, Y99
SPORTS, ATHLETIC RECREATIONAL AND SOCIAL ACTIVITIES ||
280 | Country club | N50
281 | Hobby club | N50
282 | Dinner club | N99
283 | Variety club | N99
284 | Dog club | D60
285 | Women's club; Note: Garden club (use 356) | N50, S81
286 | Hunting or fishing club | N61
287 | Swimming or tennis club | N66, N67
288 | Other sports club; Note: Boys Club, Little League, etc (use 321) | N60, N62 - N66, N68 - N6A
296 | Community center | N31, P28, O20
297 | Community recreational facilities (park, playground, etc) | N30 - N32, O20
298 | Training in sports | N40
299 | Travel tours | Q99
300 | Amateur athletic association | N60 - N6A
301 | Fundraising athletic or sports event | Common Code 11, 12
317 | Other sports or athletic activities | N20 - N99
318 | Other recreational activities | N20 - N99
319 | Other social activities | N20 - N99
YOUTH ACTIVITIES ||
320 | Boy Scouts, Girl Scouts, etc. | O40 - O43
321 | Boys Club, Little League, etc. | O20 - O23, N63
322 | FFA, FHA, 4-H club, etc. | O52
323 | Key club | O51
324 | YMCA, YWCA, YMCA, etc. | P27
325 | Camp | N20
326 | Care and housing of children (orphanage, etc) | P70
327 | Prevention of cruelty to children | I72 - I73
328 | Combat juvenile delinquency | I21, O20 - O31
349 | Other youth organization or activities | O20 - O99
CONSERVATION, ENVIRONMENTAL AND BEAUTIFICATION ACTIVITIES ||
350 | Preservation of natural resources (conservation) | C30 - C36
351 | Combating or preventing pollution (air, water, etc) | C20, C27, C34
352 | Land acquisition for preservation | C34
353 | Soil or water conservation | C30 - C34, C36, K25
354 | Preservation of scenic beauty | C20 - C99
355 | Wildlife sanctuary or refuge | D30 - D34
356 | Garden club | C42
379 | Other conservation, environmental or beautification activities | C20 - C99
HOUSING ACTIVITIES ||
380 | Low-income housing | L20 - L25, L40
381 | Low and moderate income housing | L20 - L25, L40
382 | Housing for the aged | L22, P75
398 | Instruction and guidance on housing | L30, L80
399 | Other housing activities | L20 - L99
INNER CITY OR COMMUNITY ACTIVITIES ||
400 | Area development, redevelopment of renewal | S20 - S32
401 | Homeowners association | L50
402 | Other activity aimed t combating community deterioration | S20 - S32
403 | Attracting new industry or retaining industry in an area | S30 - S41
404 | Community promotion | S20 - S99
405 | Loans or grants for minority businesses | S43
406 | Crime prevention | I20 - I33, I40, I70 - I73
407 | Voluntary firemen's organization or auxiliary | M24, M112, M122
408 | Community service organization | S80 - S82
429 | Other inner city or community benefit activities | S20 - S32, S80 - S99
CIVIL RIGHTS ACTIVITIES ||
430 | Defense of human and civil rights | R20 - R99, Q70 - Q71
431 | Elimination of prejudice and discrimination | R30
432 | Lessen neighborhood tensions | R30
449 | Other civil rights activities | R20 - R99
LITIGATION AND LEGAL AID ACTIVITIES ||
460 | Public interest litigation activities | I83
461 | Other litigation or support of litigation | I80
462 | Legal aid to indigents | I80
463 | Providing bail | I40
465 | Plan under IRC section 120 | I118
LEGISLATIVE AND POLITICAL ACTIVITIES ||
480 | Propose, support, or oppose legislation | Common Code 05
481 | Voter information on issues or candidates | R40
482 | Voter education (mechanics of registering, voting etc.) | R40
483 | Support, oppose, or rate political candidates | R014
484 | Provide facilities or services for political campaign activities | R024
509 | Other legislative and political activities | Common Code 01
ADVOCACY/ ATTEMPT TO INFLUENCE PUBLIC OPINION CONCERNING ||
510 | Firearms control | I01
511 | Selective Service System | R60
512 | National defense policy | Q01
513 | Weapons systems | Q01
514 | Government spending | W01
515 | Taxes or tax exemption | W22
516 | Separation of church and state | R60
517 | Government aid to parochial schools | R60
518 | U.S. foreign policy | Q01
519 | U.S. military involvement | Q01
520 | Pactism and peace | Q01
521 | Economic-political system of U.S. | W01
522 | Anti-communism | R60
523 | Right to work | J01
524 | Zoning or rezoning | S01
525 | Location of highway or transportation system | W01
526 | Rights of criminal defendants | R20
527 | Capital punishment | R60
528 | Stricter law enforcement | I01
529 | Ecology or conservation | C01
530 | Protection of consumer interests | W90
531 | Medical care service | E01
532 | Welfare systems | P01
533 | Urban renewal | S01
534 | Busing student to achieve racial balance | R30
535 | Racial integration | R30
536 | Use of intoxicating beverage | F01
537 | Use of drugs or narcotics | F01
538 | Use of tobacco | F01
539 | Prohibition of erotica | R63
540 | Sex education in public schools | B01
541 | Population control | R61, R62
542 | Birth control methods | R61, R62
543 | Legalized abortion | R61, R62
559 | Other matters | R99
OTHER ACTIVITIES DIRECTED TO INDIVIDUALS ||
560 | Supplying money, goods or services to the poor | K30 - K35, P20 - P99
561 | Gifts or grants to individuals (other than scholarships) | P58 - P62
562 | Other loans to individuals | W60
563 | Marriage counseling | P46
564 | Family planning | E42
565 | Credit counseling and assistance | P51
566 | Job training, counseling, or assistance | J20 - J22
567 | Draft counseling | P50
568 | Vocational counseling | J21
569 | Referral service (social agencies) | P50
572 | Rehabilitating convicts or ex-convicts | I40 - I44
573 | Rehabilitating alcoholics, drug abusers, compulsive gamblers, etc. | F20 - F30, F50 - F54, I23
574 | Day care center | P33
ACTIVITIES PURPOSES AND ACTIVITIES ||
600 | Community Chest, United Way, etc. | T70
601 | Booster club | Common Code 11
602 | Gifts, grants, or loans to other organizations | Common Code 11, 12
603 | Non-financial services of facilities to other organizations | Common Code 19
OTHER PURPOSES AND ACTIVITIES ||
900 | Cemetery or burial activities | Y50
901 | Perpetual (care fund (cemetery, columbarium, etc.) | Y50
902 | Emergency or disaster aid fund | M20
903 | Community trust or component | T70
904 | Government instrumentality or agency (see also 254) | W20
905 | Testing products for public safety | W90
906 | Consumer interest group | W90
907 | Veterans activities | W30
908 | Patriotic activities | A84, W24, W30
910 | Domestic organization with activities outside U.S. | Q20 - Q99
911 | Foreign organization | Q20 - Q99
912 | Title holding corporation | Common Code 11, S47
913 | Prevention of cruelty to animals | D20
914 | Achievement prizes or awards | W70
915 | Erection or maintenance of public building or works | W40 - W50, W80
916 | Cafeteria, restaurant, snack bar, food services, etc. | K99, Common Code 19
917 | Thrift ship, retail outlet, etc. | P29
918 | Book, gift or supply store | P29
919 | Advertising | Common Code 02
920 | Association of employees | J40
921 | Loans or credit reporting | W60
922 | Endowment fund or financial services | T20 - T99
923 | Indians (tribes, cultures, etc.) | A23
924 | Traffic or tariff bureau | W22
925 | Section 501(c)(1) with 50% deductibility | W20
926 | Government instrumentality other than section 501(c) | W20
927 | Fundraising | T20 - T99, Common Code 11, 12
928 | 4947(a)(2) Trust | T90
930 | Prepaid legal services pan exempt under IRC section 501(c)(20) | Y20
931 | Withdrawal liability payment fund 990 Section 501(k) child care organization | Y20
932 | State sponsored worker's compensation reinsurance | Y25
933 | 501(n) Charitable risk pool | Y20
934 | 529 Qualified state-sponsored tuition | B82, W60
990 | 501(k) Child care | P33
EXCEPTIONS ||
990-999 | Administrative codes | Z99
0 or 000 | Uncoded | Z99