-
Notifications
You must be signed in to change notification settings - Fork 6
/
bed.Rmd
208 lines (150 loc) · 11.8 KB
/
bed.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
---
title: "Business Employment Dynamics"
author: "Erik Loualiche"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
#output:
# md_document:
#variant: gfm
vignette: >
%\VignetteIndexEntry{Download data from Business Employment Dynamics}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
<style>
pre {
overflow-x: auto;
}
pre code {
word-wrap: normal;
white-space: pre;
}
</style>
```{r global_options, echo = FALSE, include = FALSE}
options(width = 999)
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE,
cache = FALSE, tidy = FALSE, size = "small")
```
## General information on the dataset
Downloads data from the BED website. Of main importance is the flat file with establishment level count by industry (3 digits naics) every quarter. This [page](http://www.bls.gov/bdm/bdmind3.htm) includes all the individual industry tables and the flat file is at the bottom under this [url](http://www.bls.gov/web/cewbd/bd_data_ind3.txt).
Note that there is also a [ftp](http://download.bls.gov/pub/time.series/bd/) with other data.
## Using the package
For example to start and get the BED industry data:
``` r
library(entrydatar)
dt_ind <- get_bed("industry", level = T)
```
Or if you also want to process the levels (employment and count of establishments):
```r
dt_ind[]
date_ym naics3 year period ent_emp note1 exit_emp ent_cnt exit_cnt nent_emp nent_cnt ent_lvl_emp exit_lvl_emp ent_lvl_cnt exit_lvl_cnt tot_count tot_emp
1: 199209 111 1992 Q03 4.8 P 4.7 10.9 8.9 0.1 2.0 27754 27031 4171 3402 38266.055 578208.33
2: 199209 112 1992 Q03 2.3 P 1.6 4.7 4.1 0.7 0.6 3532 2499 736 631 15659.574 153565.22
3: 199209 113 1992 Q03 3.0 P 3.7 7.1 8.3 -0.7 -1.2 2698 3353 851 1000 11985.915 89933.33
4: 199209 114 1992 Q03 13.2 P 10.1 20.4 15.4 3.1 5.0 1655 1259 457 344 2240.196 12537.88
5: 199209 115 1992 Q03 9.8 P 7.8 10.5 9.7 2.0 0.8 25944 20799 1337 1232 12733.333 264734.69
---
8696: 201706 721 2017 Q02 0.9 P 0.9 3.6 4.0 0.0 -0.4 18235 17749 2278 2518 63277.778 2026111.11
8697: 201706 722 2017 Q02 1.9 P 1.4 3.6 3.5 0.5 0.1 219145 158658 20349 19916 565250.000 11533947.37
8698: 201706 811 2017 Q02 1.6 P 1.6 3.9 4.0 0.0 -0.1 21313 21280 7819 8057 200487.179 1332062.50
8699: 201706 812 2017 Q02 1.9 P 1.7 4.3 4.3 0.2 0.0 27266 25570 8321 8283 193511.628 1435052.63
8700: 201706 813 2017 Q02 1.1 P 1.0 3.0 3.2 0.1 -0.2 14714 13594 3934 4156 131133.333 1337636.36
```
## Where does the data come from
Take for example industry `naics = 111`, *Crop Production*. The data comes from two tables:
```r
head(dt_ind[ naics3 == "111"])
date_ym naics3 year period ent_emp note1 exit_emp ent_cnt exit_cnt nent_emp nent_cnt ent_lvl_emp exit_lvl_emp ent_lvl_cnt exit_lvl_cnt tot_count tot_emp
1: 199209 111 1992 Q03 4.8 P 4.7 10.9 8.9 0.1 2.0 27754 27031 4171 3402 38266.06 578208.3
2: 199212 111 1992 Q04 4.0 P 5.1 8.2 11.1 -1.1 -2.9 22055 27995 3128 4193 38146.34 551375.0
3: 199303 111 1993 Q01 4.9 P 4.2 10.4 9.3 0.7 1.1 26148 22265 3883 3478 37336.54 533632.7
4: 199306 111 1993 Q02 5.2 P 4.0 10.6 8.6 1.2 2.0 29233 22413 4022 3281 37943.40 562173.1
5: 199309 111 1993 Q03 5.0 P 4.5 10.6 8.4 0.5 2.2 28777 26201 4143 3272 39084.91 575540.0
6: 199312 111 1993 Q04 4.0 P 4.7 7.7 10.6 -0.7 -2.9 22228 26235 2966 4094 38519.48 555700.0
```
#### [Table 7](https://www.bls.gov/web/cewbd/table7_1_ind3.txt)
+ *Private sector establishments by direction of employment change, as percent of total establishments, seasonally adjusted*
+ `ent_cnt` is *Establishment gaining jobs, Opening establishments*
+ `exit_cnt` is *Establishment losing jobs, Closing establishments*
+ `nent_cnt` is the difference between the number of opening establishments and the number of closing establishments.
```
Crop Production (Percent)
Establishments gaining jobs Establishments losing jobs
Year 3 months ended Net change(2) Total Expanding Opening Total Contracting Closing
establishments establishments establishments establishments
1992 September 2.0 43.4 32.5 10.9 41.4 32.5 8.9
December -2.9 37.5 29.3 8.2 43.8 32.7 11.1
1993 March 1.1 42.9 32.5 10.4 39.5 30.2 9.3
June 2.0 43.4 32.8 10.6 39.6 31.0 8.6
September 2.2 43.5 32.9 10.6 40.5 32.1 8.4
December -2.9 37.5 29.8 7.7 43.6 33.0 10.6
```
#### [Table 3](https://www.bls.gov/web/cewbd/table3_1_ind3.txt)
+ *Private sector gross job gains and losses, as a percent of employment, seasonally adjusted*
+ `ent_emp` is *Gross job gains, Opening establishments*
+ `exit_emp` is *Gross job losses, Closing establishments*
+ `nent_emp` Net change is the difference between total gross job gains and total gross job losses.
```
Crop Production (Percent)
Gross job gains Gross job losses
Year 3 months ended Net change(2) Total Expanding Opening Total Contracting Closing
establishments establishments establishments establishments
1992 September -1.4 32.4 27.6 4.8 33.8 29.1 4.7
December -2.0 29.1 25.1 4.0 31.1 26.0 5.1
1993 March 0.6 28.7 23.8 4.9 28.1 23.9 4.2
June 3.0 31.7 26.5 5.2 28.7 24.7 4.0
September -0.8 31.2 26.2 5.0 32.0 27.5 4.5
December -0.7 29.4 25.4 4.0 30.1 25.4 4.7
```
### Some more details about where the data actually comes from:
#### [Table 5](https://www.bls.gov/web/cewbd/table5_1_ind3.txt)
```
Crop Production
Establishments gaining jobs Establishments losing jobs
Year 3 months ended Net change(1) Total Expanding Opening Total Contracting Closing
establishments establishments establishments establishments
1992 September 769 16,623 12,452 4,171 15,874 12,472 3,402
December -1,065 14,226 11,098 3,128 16,587 12,394 4,193
```
+ *Number of private sector establishments by direction of employment change, seasonally adjusted*
+ The variable `ent_cnt` (and respectively `exit_cnt` and `nent_cnt`) is the ratio of *establishments gaining jobs: opening establishments* over the total number of establishments both *gaining jobs* and *losing jobs* adjusted for their share in the total number of establishments in the economy
+ Example for 1992Q3: Opening establishments is 4171. Total establishments gaining jobs is 16623. The fraction of total establishments gaining jobs is 43.4% (see Table 7). So the entry rate is 4171 / (16623 / 0.434) = 10.9%
#### [Table 1](https://www.bls.gov/web/cewbd/table5_1_ind3.txt)
```
Crop Production
Gross job gains Gross job losses
Year 3 months ended Net change(1) Total Expanding Opening Total Contracting Closing
establishments establishments establishments establishments
1992 September -7,856 187,375 159,621 27,754 195,231 168,200 27,031
December -11,035 160,672 138,617 22,055 171,707 143,712 27,995
```
+ *Number of private sector establishments by direction of employment change, seasonally adjusted*
+ The variable `ent_emp` (and respectively `exit_emp` and `nent_emp`) is the ratio of *establishments gaining jobs: opening establishments* over the total number of establishments both *gaining jobs* and *losing jobs* adjusted for their share in the total employment of establishments in the economy
+ Example for 1992Q3: Employment gains for opening establishments is 27,754. The fraction of total establishments gaining jobs is 32.4% (as a fraction of employment, see Table 3). So the employment weighted entry rate is 27754 / (187375 * 0.324) = 4.6%.
---------------------
## Other elements in the package (Work in Progress)
All the flat files are available [here](https://download.bls.gov/pub/time.series/bd/). Of main importance is the [doc](https://download.bls.gov/pub/time.series/bd/bd.txt)
To find a series it is important to read the series ID, for example `BDS0000000000000000210101LQ5` which can be broken out into:
+ data abbreviation: `BD`
+ `seasonal_code`: `S` Seasonally adjusted, `U` Not seasonally adjusted
+ `msa_code`: `00000` National
+ `state_code`: `00` U.S. totals, see [docs](https://download.bls.gov/pub/time.series/bd/bd.state)
+ `county_code`: `000`
+ `industry_code`: `000000` Total Private, see [doc](https://download.bls.gov/pub/time.series/bd/bd.industry) for breakdown by naics two and three digits.
+ `unitanalysis_code`: `1` Establishment
+ `dataelement_code`: `1` Employment, `2` Number of Establishments
+ `sizeclass_code`: `00`: All size classes and see [docs](https://download.bls.gov/pub/time.series/bd/bd.sizeclass) for other
+ `dataclass_code`: `01` Gross Job Gains, `02` Expansions, `03` Openings, `04` Gross Job Losses, `05` Contractions, `06` Closings, `07` Establishment Births, `08` Establishment Deaths
+ `ratelevel_code`: `L` Level, `R` Rate
+ `periodicity_code`: `A` Annual, `Q` Quarterly
+ `ownership_code`: `5` Private Sector
To be able to get all these series the code is required to download the full flat file which can be quite heavy (requires confirmation).
```r
library(entrydatar)
dt_ind <- get_bed_detail("industry")
dt_ind[]
```
## Other information
Business Employment Dynamics Program Contacts is available via email at: [email protected] or by phone on 202-691-6553.
------------------------------------------------------------------------
1. Erik Loualiche