├── .Rbuildignore ├── .gitignore ├── .travis.yml ├── CRAN-RELEASE ├── DESCRIPTION ├── NAMESPACE ├── NEWS.md ├── R ├── aaa.r ├── annual-wages-by-wage-group.R ├── compensation-wages-benefits.R ├── employment.r ├── epi_query.r ├── epidata-package.R ├── gaps.r ├── health.r ├── minimum-wage.R ├── pension.r ├── poverty.R ├── productivity.r ├── union.r ├── utils.r ├── wage_decomposition.r ├── wages.r └── wages_and_hours.r ├── README.Rmd ├── README.md ├── README_files └── figure-gfm │ └── unnamed-chunk-4-1.png ├── cran-comments.md ├── docs ├── authors.html ├── index.html ├── jquery.sticky-kit.min.js ├── link.svg ├── news │ └── index.html ├── pkgdown.css ├── pkgdown.js └── reference │ ├── epidata.html │ ├── get_black_white_wage_gap.html │ ├── get_college_wage_premium.html │ ├── get_employment_to_population_ratio.html │ ├── get_gender_wage_gap.html │ ├── get_hispanic_white_wage_gap.html │ ├── get_labor_force_participation_rate.html │ ├── get_long_term_unemployment.html │ ├── get_median_and_mean_wages.html │ ├── get_non_high_school_wage_penalty.html │ ├── get_underemployment.html │ ├── get_unemployment.html │ ├── get_unemployment_by_state.html │ ├── get_wage_ratios.html │ ├── get_wages_by_education.html │ ├── get_wages_by_percentile.html │ └── index.html ├── epidata.Rproj ├── inst └── tinytest │ └── test_epidata.R ├── man ├── epidata.Rd ├── figures │ ├── README-unnamed-chunk-1-1.png │ └── README-unnamed-chunk-4-1.png ├── get_annual_wages_and_work_hours.Rd ├── get_annual_wages_by_wage_group.Rd ├── get_black_white_wage_gap.Rd ├── get_college_wage_premium.Rd ├── get_compensation_wages_and_benefits.Rd ├── get_employment_to_population_ratio.Rd ├── get_gender_wage_gap.Rd ├── get_health_insurance_coverage.Rd ├── get_hispanic_white_wage_gap.Rd ├── get_labor_force_participation_rate.Rd ├── get_long_term_unemployment.Rd ├── get_median_and_mean_wages.Rd ├── get_minimum_wage.Rd ├── get_non_high_school_wage_penalty.Rd ├── get_pension_coverage.Rd ├── get_poverty_level_wages.Rd ├── get_productivity_and_hourly_compensation.Rd ├── get_underemployment.Rd ├── get_unemployment.Rd ├── get_unemployment_by_state.Rd ├── get_union_coverage.Rd ├── get_wage_decomposition.Rd ├── get_wage_ratios.Rd ├── get_wages_by_education.Rd ├── get_wages_by_percentile.Rd └── not_dos.Rd └── tests └── tinytest.R /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^CRAN-RELEASE$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | ^\.travis\.yml$ 5 | ^README\.*Rmd$ 6 | ^README\.Rmd$ 7 | ^README\.*html$ 8 | ^NOTES\.*Rmd$ 9 | ^NOTES\.*html$ 10 | ^docs$ 11 | ^README\.*$ 12 | ^README_files$ 13 | ^cran-comments\.md$ 14 | ^Dockerfile$ 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Rproj 5 | src/*.o 6 | src/*.so 7 | src/*.dll 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: r 2 | warnings_are_errors: true 3 | sudo: required 4 | 5 | r: 6 | - oldrel 7 | - release 8 | - devel 9 | 10 | apt_packages: 11 | - libv8-dev 12 | - xclip 13 | 14 | env: 15 | global: 16 | - CRAN: http://cran.rstudio.com 17 | 18 | notifications: 19 | email: 20 | - bob@rud.is 21 | irc: 22 | channels: 23 | - "104.236.112.222#builds" 24 | nick: travisci 25 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2019-04-11. 2 | Once it is accepted, delete this file and tag the release (commit 71bde7c94c). 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: epidata 2 | Type: Package 3 | Title: Tools to Retrieve Economic Policy Institute Data Library Extracts 4 | Version: 0.4.0 5 | Date: 2020-08-25 6 | Authors@R: c(person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"))) 7 | Maintainer: Bob Rudis 8 | Encoding: UTF-8 9 | Description: The Economic Policy Institute () provides 10 | researchers, media, and the public with easily accessible, up-to-date, and 11 | comprehensive historical data on the American labor force. It is compiled 12 | from Economic Policy Institute analysis of government data sources. Use 13 | it to research wages, inequality, and other economic indicators over time 14 | and among demographic groups. Data is usually updated monthly. 15 | URL: https://gitlab.com/hrbrmstr/epidata 16 | BugReports: https://gitlab.com/hrbrmstr/epidata/issues 17 | License: AGPL 18 | Depends: 19 | R (>= 3.6.0) 20 | Imports: 21 | purrr, 22 | httr, 23 | jsonlite, 24 | dplyr, 25 | rvest, 26 | xml2, 27 | tidyr, 28 | readr, 29 | stringi, 30 | tinytest 31 | RoxygenNote: 7.1.1 32 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(get_annual_wages_and_work_hours) 4 | export(get_annual_wages_by_wage_group) 5 | export(get_black_white_wage_gap) 6 | export(get_college_wage_premium) 7 | export(get_compensation_wages_and_benefits) 8 | export(get_employment_to_population_ratio) 9 | export(get_gender_wage_gap) 10 | export(get_health_insurance_coverage) 11 | export(get_hispanic_white_wage_gap) 12 | export(get_labor_force_participation_rate) 13 | export(get_long_term_unemployment) 14 | export(get_median_and_mean_wages) 15 | export(get_minimum_wage) 16 | export(get_non_high_school_wage_penalty) 17 | export(get_pension_coverage) 18 | export(get_poverty_level_wages) 19 | export(get_productivity_and_hourly_compensation) 20 | export(get_underemployment) 21 | export(get_unemployment) 22 | export(get_unemployment_by_state) 23 | export(get_union_coverage) 24 | export(get_wage_decomposition) 25 | export(get_wage_ratios) 26 | export(get_wages_by_education) 27 | export(get_wages_by_percentile) 28 | export(not_dos) 29 | import(httr) 30 | importFrom(dplyr,"%>%") 31 | importFrom(dplyr,mutate_all) 32 | importFrom(jsonlite,fromJSON) 33 | importFrom(purrr,"%||%") 34 | importFrom(purrr,discard) 35 | importFrom(purrr,keep) 36 | importFrom(purrr,map) 37 | importFrom(purrr,map_chr) 38 | importFrom(purrr,map_df) 39 | importFrom(readr,type_convert) 40 | importFrom(rvest,html_text) 41 | importFrom(stats,setNames) 42 | importFrom(stringi,"%s+%") 43 | importFrom(stringi,stri_replace_all_fixed) 44 | importFrom(stringi,stri_replace_all_regex) 45 | importFrom(stringi,stri_trans_tolower) 46 | importFrom(tidyr,gather) 47 | importFrom(utils,getFromNamespace) 48 | importFrom(xml2,read_html) 49 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # epidata 0.3.0 2 | 3 | * Added a `NEWS.md` file to track changes to the package. 4 | * Added a package user-agent to httr calls 5 | * Changed http: epidata URLS to https: 6 | * Moved DESCRIPTION refs to GitLab 7 | * Fixed CRAN check errors due to new epidata API endpoint 8 | * Added 4 new data sources: "Annual wages by wage group", 9 | "Compensation, wages, and benefits", "Minimum wage", "Poverty-level wages" 10 | -------------------------------------------------------------------------------- /R/aaa.r: -------------------------------------------------------------------------------- 1 | globalVariables(c("date", "region", "value")) 2 | 3 | as_data_frame <- function(x) { 4 | dplyr::as_tibble(as.data.frame(x)) 5 | } 6 | 7 | httr::user_agent( 8 | sprintf( 9 | "epidata package v%s: (<%s>)", 10 | utils::packageVersion("epidata"), 11 | utils::packageDescription("epidata")$URL 12 | ) 13 | ) -> .EPIDATA_UA 14 | 15 | 16 | #' Not DoS'ing EPI/Cloudflare 17 | #' 18 | #' @return logical 19 | #' @export 20 | not_dos <- function() { 21 | utils::getFromNamespace("interactive", "base")() 22 | } -------------------------------------------------------------------------------- /R/annual-wages-by-wage-group.R: -------------------------------------------------------------------------------- 1 | #' Annual wages by wage group 2 | #' 3 | #' Return the average annual salaries for select wage groups, with particular focus on 4 | #' the highest wage earners. Note that this data is not directly comparable to wage 5 | #' deciles/percentiles. 6 | #' 7 | #' Wages are in 2017 dollars. Population sample: All workers. 8 | #' 9 | #' The average annual wages by wage group are taken from a 2010 article by Wojciech Kopczuk, 10 | #' Emmanuel Saez, and Jae Song. To extend this series, data for 2006 through 2017 are 11 | #' extrapolated from 2004 data using changes in wage shares computed from Social Security 12 | #' Administration wage statistics. We employ the midpoint of the bracket to compute total 13 | #' wage income in each bracket and sum all brackets. We then use interpolation to derive 14 | #' percentile cutoffs building from the bottom up to obtain the 0–90th percentile bracket 15 | #' and then estimate the remaining categories. This allows us to estimate the wage shares 16 | #' for upper wage groups. We use these wage shares computed for 2004 and later years to 17 | #' extend the Kopczuk, Saez, and Song series by adding the changes in share between 2004 18 | #' and the relevant year to their series. To obtain absolute wage trends we use the SSA data 19 | #' on the total wage pool and employment and compute the real wage per worker (based on t 20 | #' heir share of wages and employment) in the different groups in 2017 dollars. For a 21 | #' detailed explanation, see the methodology for annual wages and hours. 22 | #' 23 | #' @return \code{tbl_df} with data filtered by the selected criteria. 24 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 25 | #' @note Data source: SSA | Kopczuk, Saez, and Song (2010) 26 | #' @return data frame 27 | #' @export 28 | #' @examples 29 | #' if (not_dos()) get_annual_wages_by_wage_group() 30 | get_annual_wages_by_wage_group <- function() { 31 | 32 | params <- list(subject="wagegroup") 33 | 34 | res <- epi_query(params) 35 | if (is.null(res)) return(data.frame()) 36 | 37 | cols <- stringi::stri_trans_tolower(res$columns$name) 38 | cols <- stringi::stri_replace_all_regex(cols, "[\\('%\\)]", "") 39 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 40 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 41 | "_") 42 | cols <- stringi::stri_replace_first_regex(cols, "([[:digit:]])", "x_$1") 43 | 44 | out <- setNames(as_data_frame(res$data), cols) 45 | out <- dplyr::mutate_all(out, "clean_cols") 46 | out <- suppressMessages(readr::type_convert(out)) 47 | 48 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 49 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 50 | 51 | out 52 | 53 | } 54 | -------------------------------------------------------------------------------- /R/compensation-wages-benefits.R: -------------------------------------------------------------------------------- 1 | #' Compensation, wages, and benefits 2 | #' 3 | #' Return the nonwage payments, referred to as fringe benefits, and wages. 4 | #' Compensation includes employer payments for health insurance, pensions, 5 | #' and payroll taxes (primarily payments toward Social Security and unemployment insurance). 6 | #' 7 | #' Wages are in 2016 dollars. Wage and salary workers (NIPA) | Private-sector workers (ECEC) 8 | #' 9 | #' @return \code{tbl_df} with data filtered by the selected criteria. 10 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 11 | #' @note Data source: NIPA | ECEC 12 | #' @return data frame 13 | #' @export 14 | #' @examples 15 | #' if (not_dos()) get_compensation_wages_and_benefits() 16 | get_compensation_wages_and_benefits <- function() { 17 | 18 | params <- list(subject="compben") 19 | 20 | res <- epi_query(params) 21 | if (is.null(res)) return(data.frame()) 22 | 23 | cols <- stringi::stri_trans_tolower(res$columns$name) 24 | cols <- stringi::stri_replace_all_regex(cols, "[\\('%,\\)]", "") 25 | cols <- stringi::stri_replace_all_fixed(cols, "&", "_and_") 26 | cols <- stringi::stri_replace_all_fixed(cols, "/", "_") 27 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 28 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 29 | "_") 30 | cols <- stringi::stri_replace_first_regex(cols, "([[:digit:]])", "x_$1") 31 | cols <- stringi::stri_replace_all_regex(cols, "_+", "_") 32 | 33 | out <- setNames(as_data_frame(res$data), cols) 34 | out <- dplyr::mutate_all(out, "clean_cols") 35 | out <- suppressMessages(readr::type_convert(out)) 36 | 37 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 38 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 39 | 40 | out 41 | 42 | } 43 | -------------------------------------------------------------------------------- /R/employment.r: -------------------------------------------------------------------------------- 1 | #' Retreive the share of the labor force without a job 2 | #' 3 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 4 | #' \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 5 | #' unemployment data by gender, race and education, you would set this parameter to "\code{gre}". 6 | #' @return \code{tbl_df} with data filtered by the selected criteria. 7 | #' @note See \code{get_unemployment_by_state()} for information on retrieving unemployment by state+race. 8 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 9 | #' @export 10 | #' @examples 11 | #' get_unemployment() 12 | #' 13 | #' get_unemployment("r") 14 | #' 15 | #' get_unemployment("grae") 16 | get_unemployment <- function(by=NULL) { 17 | 18 | params <- list(subject="unemp") 19 | 20 | if (!is.null(by)) params <- make_params(params, by, c("g", "r", "a", "e")) 21 | 22 | res <- epi_query(params) 23 | if (is.null(res)) return(data.frame()) 24 | 25 | cols <- stringi::stri_trans_tolower(res$columns$name) 26 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 27 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 28 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 29 | "_") 30 | out <- setNames(as_data_frame(res$data), cols) 31 | out <- dplyr::mutate_all(out, "clean_cols") 32 | out <- suppressMessages(readr::type_convert(out)) 33 | 34 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 35 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 36 | 37 | out 38 | 39 | } 40 | 41 | #' Retreive the share of the labor force without a job (by state) 42 | #' 43 | #' @param by \code{NULL} or \code{r} for a partition by race. 44 | #' @return \code{tbl_df} with data filtered by the selected criteria. 45 | #' @note See \code{get_unemployment()} for other unemployment extracts.. 46 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 47 | #' @export 48 | #' @examples 49 | #' get_unemployment_by_state() 50 | #' 51 | #' get_unemployment_by_state("r") 52 | get_unemployment_by_state <- function(by=NULL) { 53 | 54 | params <- list(subject="unempstate") 55 | 56 | if (!is.null(by)) params <- make_params(params, by, c("r")) 57 | 58 | res <- epi_query(params) 59 | if (is.null(res)) return(data.frame()) 60 | 61 | cols <- stringi::stri_trans_tolower(res$columns$name) 62 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 63 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 64 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 65 | "_") 66 | out <- setNames(as_data_frame(res$data), cols) 67 | out <- dplyr::mutate_all(out, "clean_cols") 68 | out <- suppressMessages(readr::type_convert(out)) 69 | out <- tidyr::gather(out, region, value, -date) 70 | 71 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 72 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 73 | 74 | out 75 | 76 | } 77 | 78 | #' Retreive the share of the labor force that has been unemployed for six months or longer 79 | #' 80 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 81 | #' \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 82 | #' unemployment data by gender, race and education, you would set this parameter to "\code{gre}". 83 | #' @return \code{tbl_df} with data filtered by the selected criteria. 84 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 85 | #' @export 86 | #' @examples 87 | #' get_long_term_unemployment() 88 | #' 89 | #' get_long_term_unemployment("r") 90 | #' 91 | #' get_long_term_unemployment("grae") 92 | get_long_term_unemployment <- function(by=NULL) { 93 | 94 | params <- list(subject="ltunemp") 95 | 96 | if (!is.null(by)) params <- make_params(params, by, c("g", "r", "a", "e")) 97 | 98 | res <- epi_query(params) 99 | if (is.null(res)) return(data.frame()) 100 | 101 | cols <- stringi::stri_trans_tolower(res$columns$name) 102 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 103 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 104 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 105 | "_") 106 | out <- setNames(as_data_frame(res$data), cols) 107 | out <- dplyr::mutate_all(out, "clean_cols") 108 | out <- suppressMessages(readr::type_convert(out)) 109 | 110 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 111 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 112 | 113 | out 114 | 115 | } 116 | 117 | #' Retreive the share of the labor force that is "underemployed" 118 | #' 119 | #' Underemployment is the share of the labor force that either 1) is unemployed, 2) is 120 | #' working part time but wants and is available to work full time (an "involuntary" part 121 | #' timer), or 3) wants and is available to work and has looked for work in the last year 122 | #' but has given up actively seeking work in the last four weeks ("marginally attached" 123 | #' worker). 124 | #' 125 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 126 | #' \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 127 | #' unemployment data by gender, race and education, you would set this parameter to "\code{gre}". 128 | #' @return \code{tbl_df} with data filtered by the selected criteria. 129 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 130 | #' @export 131 | #' @examples 132 | #' get_underemployment() 133 | #' 134 | #' get_underemployment("r") 135 | #' 136 | #' get_underemployment("grae") 137 | get_underemployment <- function(by=NULL) { 138 | 139 | params <- list(subject="underemp") 140 | 141 | if (!is.null(by)) params <- make_params(params, by, c("g", "r", "a", "e")) 142 | 143 | res <- epi_query(params) 144 | if (is.null(res)) return(data.frame()) 145 | 146 | cols <- stringi::stri_trans_tolower(res$columns$name) 147 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 148 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 149 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 150 | "_") 151 | out <- setNames(as_data_frame(res$data), cols) 152 | out <- dplyr::mutate_all(out, "clean_cols") 153 | out <- suppressMessages(readr::type_convert(out)) 154 | 155 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 156 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 157 | 158 | out 159 | 160 | } 161 | 162 | #' Retreive the share of the civilian noninstitutional population that is in the labor force 163 | #' 164 | #' (i.e., working or looking for work) 165 | #' 166 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 167 | #' \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 168 | #' unemployment data by gender, race and education, you would set this parameter to "\code{gre}". 169 | #' @return \code{tbl_df} with data filtered by the selected criteria. 170 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 171 | #' @export 172 | #' @examples 173 | #' get_labor_force_participation_rate() 174 | #' 175 | #' get_labor_force_participation_rate("r") 176 | #' 177 | #' get_labor_force_participation_rate("grae") 178 | get_labor_force_participation_rate <- function(by=NULL) { 179 | 180 | params <- list(subject="lfpr") 181 | 182 | if (!is.null(by)) params <- make_params(params, by, c("g", "r", "a", "e")) 183 | 184 | res <- epi_query(params) 185 | if (is.null(res)) return(data.frame()) 186 | 187 | cols <- stringi::stri_trans_tolower(res$columns$name) 188 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 189 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 190 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 191 | "_") 192 | out <- setNames(as_data_frame(res$data), cols) 193 | out <- dplyr::mutate_all(out, "clean_cols") 194 | out <- suppressMessages(readr::type_convert(out)) 195 | 196 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 197 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 198 | 199 | out 200 | 201 | } 202 | 203 | #' Retreive the share of the civilian noninstitutional population that is employed 204 | #' 205 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 206 | #' \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 207 | #' unemployment data by gender, race and education, you would set this parameter to "\code{gre}". 208 | #' @return \code{tbl_df} with data filtered by the selected criteria. 209 | #' @export 210 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 211 | #' @return data frame 212 | #' @examples 213 | #' if (not_dos()) get_employment_to_population_ratio() 214 | #' 215 | #' if (not_dos()) get_employment_to_population_ratio("r") 216 | #' 217 | #' if (not_dos()) get_employment_to_population_ratio("grae") 218 | get_employment_to_population_ratio <- function(by=NULL) { 219 | 220 | params <- list(subject="epop") 221 | 222 | if (!is.null(by)) params <- make_params(params, by, c("g", "r", "a", "e")) 223 | 224 | res <- epi_query(params) 225 | if (is.null(res)) return(data.frame()) 226 | 227 | cols <- stringi::stri_trans_tolower(res$columns$name) 228 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 229 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 230 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 231 | "_") 232 | out <- setNames(as_data_frame(res$data), cols) 233 | out <- dplyr::mutate_all(out, "clean_cols") 234 | out <- suppressMessages(readr::type_convert(out)) 235 | 236 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 237 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 238 | 239 | out 240 | 241 | } -------------------------------------------------------------------------------- /R/epi_query.r: -------------------------------------------------------------------------------- 1 | # Do the hard work of formatting the parameters and issuing the query 2 | epi_query <- function(args) { 3 | 4 | qs <- paste(sprintf("%s=%s", names(args), args), collapse="&") 5 | 6 | httr::POST( 7 | "https://www.epi.org/wordpress/wp-admin/admin-ajax.php", 8 | httr::add_headers( 9 | `X-Requested-With` = "XMLHttpRequest", 10 | `Referer` = "https://www.epi.org/data/" 11 | ), 12 | .EPIDATA_UA, 13 | encode = "form", 14 | body = list( 15 | action = "epi_getdata", 16 | queryString = qs 17 | ) 18 | ) -> res 19 | 20 | if (httr::status_code(res) != 200) { 21 | warning("EPI API is unresponsive. Please try again later.", call. = FALSE) 22 | return(NULL) 23 | } 24 | 25 | jsonlite::fromJSON(httr::content(res, as="text"), flatten=TRUE) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /R/epidata-package.R: -------------------------------------------------------------------------------- 1 | #' A package to Tools to Retrieve Economic Policy Institute Data Library Extracts 2 | #' 3 | #' The Economic Policy Institute provides researchers, media, and the public with easily 4 | #' accessible, up-to-date, and comprehensive historical data on the American labor force. 5 | #' It is compiled from Economic Policy Institute analysis of government data sources. Use 6 | #' it to research wages, inequality, and other economic indicators over time and among 7 | #' demographic groups. Data is usually updated monthly. 8 | #' 9 | #' @name epidata 10 | #' @docType package 11 | #' @author Bob Rudis (bob@@rud.is) 12 | #' @keywords internal 13 | #' @importFrom purrr map map_df map_chr keep discard %||% 14 | #' @importFrom stringi stri_replace_all_regex stri_trans_tolower %s+% stri_replace_all_fixed 15 | #' @importFrom dplyr %>% mutate_all 16 | #' @import httr 17 | #' @importFrom readr type_convert 18 | #' @importFrom jsonlite fromJSON 19 | #' @importFrom rvest html_text 20 | #' @importFrom xml2 read_html 21 | #' @importFrom tidyr gather 22 | #' @importFrom stats setNames 23 | #' @importFrom utils getFromNamespace 24 | NULL 25 | -------------------------------------------------------------------------------- /R/health.r: -------------------------------------------------------------------------------- 1 | #' Retreive Health Insurance Coverage 2 | #' 3 | #' Employer-sponsored health insurance (ESI) coverage shows the share of workers who 4 | #' received health insurance from their own job for which their employer paid for at 5 | #' least some of their health insurance coverage. 6 | #' 7 | #' Population sample: Private-sector workers age 18–64 & at least 20 hours/week and 26 weeks/year 8 | #' 9 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 10 | #' \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 11 | #' i.e. if you want to retrieve unemployment data by gender and race, you would set this 12 | #' parameter to "\code{gr}". 13 | #' @return \code{tbl_df} with data filtered by the selected criteria. 14 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 15 | #' @note Data source: CPS ASEC 16 | #' @return data frame 17 | #' @export 18 | #' @examples 19 | #' if (not_dos()) get_health_insurance_coverage() 20 | #' 21 | #' if (not_dos()) get_health_insurance_coverage("r") 22 | #' 23 | #' if (not_dos()) get_health_insurance_coverage("gr") 24 | get_health_insurance_coverage <- function(by=NULL) { 25 | 26 | params <- list(subject="healthcov") 27 | 28 | if (!is.null(by)) { 29 | params <- make_params(params, by, c("g", "r", "e", "d", "l")) 30 | } 31 | names(params) <- gsub("^l$", "el", names(params)) 32 | 33 | res <- epi_query(params) 34 | if (is.null(res)) return(data.frame()) 35 | 36 | cols <- stringi::stri_trans_tolower(res$columns$name) 37 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 38 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 39 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 40 | "_") 41 | out <- setNames(as_data_frame(res$data), cols) 42 | out <- dplyr::mutate_all(out, "clean_cols") 43 | out <- suppressMessages(readr::type_convert(out)) 44 | 45 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 46 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 47 | 48 | out 49 | 50 | } -------------------------------------------------------------------------------- /R/minimum-wage.R: -------------------------------------------------------------------------------- 1 | #' Minimum wage 2 | #' 3 | #' Return tthe hourly minimum wage set by federal law. The real minimum wage is the federal 4 | #' hourly minimum wage adjusted for inflation. 5 | #' 6 | #' Wages are in 2016 dollars, excluding the nominal federal minimum wage. Share of average 7 | #' wages based on the average wages of production and nonsupervisory workers. For state 8 | #' minimum wages, see EPI’s minimum wage tracker. 9 | #' 10 | #' Population sample: Production and nonsupervisory workers (average wages) 11 | #' 12 | #' @return \code{tbl_df} with data filtered by the selected criteria. 13 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 14 | #' @note Data source: U.S. Department of Labor Wage and Hour Division | CES 15 | #' @return data frame 16 | #' @export 17 | #' @examples 18 | #' if (not_dos()) get_minimum_wage() 19 | get_minimum_wage <- function() { 20 | 21 | params <- list(subject="minwage") 22 | 23 | res <- epi_query(params) 24 | if (is.null(res)) return(data.frame()) 25 | 26 | cols <- stringi::stri_trans_tolower(res$columns$name) 27 | cols <- stringi::stri_replace_all_regex(cols, "[\\('%,\\)]", "") 28 | cols <- stringi::stri_replace_all_fixed(cols, "&", "_and_") 29 | cols <- stringi::stri_replace_all_fixed(cols, "/", "_") 30 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 31 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 32 | "_") 33 | cols <- stringi::stri_replace_first_regex(cols, "([[:digit:]])", "x_$1") 34 | cols <- stringi::stri_replace_all_regex(cols, "_+", "_") 35 | 36 | out <- setNames(as_data_frame(res$data), cols) 37 | out <- dplyr::mutate_all(out, "clean_cols") 38 | out <- suppressMessages(readr::type_convert(out)) 39 | 40 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 41 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 42 | 43 | out 44 | 45 | } 46 | -------------------------------------------------------------------------------- /R/pension.r: -------------------------------------------------------------------------------- 1 | #' Retreive Pension Coverage 2 | #' 3 | #' Employer-provided pension coverage shows the share of workers included in an 4 | #' employer-provided plan for which the employer paid for at least some of their pension 5 | #' coverage. 6 | #' 7 | #' Population sample: Private-sector workers age 18–64 & at least 20 hours/week and 26 weeks/year 8 | #' 9 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 10 | #' \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 11 | #' i.e. if you want to retrieve pension data by gender and race, you would set this 12 | #' parameter to "\code{gr}". 13 | #' @return \code{tbl_df} with data filtered by the selected criteria. 14 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 15 | #' @note Data source: CPS ASEC 16 | #' @return data frame 17 | #' @export 18 | #' @examples 19 | #' if (not_dos()) get_health_insurance_coverage() 20 | #' 21 | #' if (not_dos()) get_health_insurance_coverage("r") 22 | #' 23 | #' if (not_dos()) get_health_insurance_coverage("gr") 24 | get_pension_coverage <- function(by=NULL) { 25 | 26 | params <- list(subject="pensioncov") 27 | 28 | if (!is.null(by)) { 29 | params <- make_params(params, by, c("g", "r", "e", "d", "l")) 30 | } 31 | names(params) <- gsub("^l$", "el", names(params)) 32 | 33 | res <- epi_query(params) 34 | if (is.null(res)) return(data.frame()) 35 | 36 | cols <- stringi::stri_trans_tolower(res$columns$name) 37 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 38 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 39 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 40 | "_") 41 | out <- setNames(as_data_frame(res$data), cols) 42 | out <- dplyr::mutate_all(out, "clean_cols") 43 | out <- suppressMessages(readr::type_convert(out)) 44 | 45 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 46 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 47 | 48 | out 49 | 50 | } -------------------------------------------------------------------------------- /R/poverty.R: -------------------------------------------------------------------------------- 1 | #' Poverty-level wages 2 | #' 3 | #' Return the share of workers earning equal to or less than the poverty-level wage, or 4 | #' the hourly wage that a full-time, year-round worker must earn to sustain a family of 5 | #' four with two children at the official poverty threshold. 6 | #' 7 | #' Population sample: Wage and salary workers age 18–64. Data source: CPS ORG | Census 8 | #' Bureau (poverty threshold) 9 | #' 10 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender) or 11 | #' \code{r} (Race), i.e. if you want to retrieve 12 | #' unemployment data by gender and race, you would set this parameter to "\code{gr}". 13 | #' @return \code{tbl_df} with data filtered by the selected criteria. 14 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 15 | #' @return data frame 16 | #' @export 17 | #' @examples 18 | #' if (not_dos()) get_poverty_level_wages() 19 | #' 20 | #' if (not_dos()) get_poverty_level_wages("r") 21 | #' 22 | #' if (not_dos()) get_poverty_level_wages("gr") 23 | get_poverty_level_wages <- function(by=NULL) { 24 | 25 | params <- list(subject="povwage") 26 | 27 | if (!is.null(by)) { 28 | params <- make_params(params, by, c("g", "r")) 29 | # params <- c(params, list(subject="wage", d="10,50,95,5010,9550,mean")) 30 | } 31 | 32 | res <- epi_query(params) 33 | if (is.null(res)) return(data.frame()) 34 | 35 | cols <- stringi::stri_trans_tolower(res$columns$name) 36 | cols <- stringi::stri_replace_all_regex(cols, "[\\('%\\+\\)]", "") 37 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 38 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 39 | "_") 40 | cols <- stringi::stri_replace_first_regex(cols, "([[:digit:]])", "x_$1") 41 | cols <- stringi::stri_replace_all_regex(cols, "_+", "_") 42 | 43 | out <- setNames(as_data_frame(res$data), cols) 44 | out <- dplyr::mutate_all(out, "clean_cols") 45 | out <- suppressMessages(readr::type_convert(out)) 46 | 47 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 48 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 49 | 50 | out 51 | 52 | } 53 | -------------------------------------------------------------------------------- /R/productivity.r: -------------------------------------------------------------------------------- 1 | #' Retreive Productivity and hourly compensation 2 | #' 3 | #' Productivity is how much workers produce per hour, or the growth of output of goods and 4 | #' services minus depreciation per hour worked. Compensation is made up of both nonwage 5 | #' payments and wages. 6 | #' 7 | #' Wages are in 2015 dollars. Median compensation is calculated using hourly wage medians 8 | #' from the CPS ORG and compensation from NIPA. 9 | #' 10 | #' Population sample: All workers & Production and nonsupervisory workers 11 | #' 12 | #' @param by \code{NULL} or character string of \code{g} (Gender) 13 | #' @return \code{tbl_df} with data filtered by the selected criteria. 14 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 15 | #' @note Data source: NIPA (compensation) | BLS Productivity Data 16 | #' @return data frame 17 | #' @export 18 | #' @examples 19 | #' if (not_dos()) get_productivity_and_hourly_compensation() 20 | #' 21 | #' if (not_dos()) get_productivity_and_hourly_compensation("g") 22 | get_productivity_and_hourly_compensation <- function(by=NULL) { 23 | 24 | params <- list(subject="prodpay") 25 | 26 | if (!is.null(by)) { 27 | params <- make_params(params, by, "g") 28 | } 29 | 30 | res <- epi_query(params) 31 | if (is.null(res)) return(data.frame()) 32 | 33 | cols <- stringi::stri_trans_tolower(res$columns$name) 34 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 35 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 36 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 37 | "_") 38 | out <- setNames(as_data_frame(res$data), cols) 39 | out <- dplyr::mutate_all(out, "clean_cols") 40 | out <- suppressMessages(readr::type_convert(out)) 41 | 42 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 43 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 44 | 45 | out 46 | 47 | } 48 | -------------------------------------------------------------------------------- /R/union.r: -------------------------------------------------------------------------------- 1 | #' Retreive Union Coverage 2 | #' 3 | #' The union coverage rate shows the percentage of the workforce covered by a collective 4 | #' bargaining agreement. 5 | #' 6 | #' @return \code{tbl_df} 7 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 8 | #' @note Data source: CPS ORG | Hirsch and Macpherson (2003) 9 | #' @return data frame 10 | #' @export 11 | #' @examples 12 | #' if (interactive()) get_union_coverage() 13 | get_union_coverage <- function() { 14 | 15 | params <- list(subject="unioncov") 16 | 17 | res <- epi_query(params) 18 | if (is.null(res)) return(data.frame()) 19 | 20 | cols <- stringi::stri_trans_tolower(res$columns$name) 21 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 22 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 23 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 24 | "_") 25 | out <- setNames(as_data_frame(res$data), cols) 26 | out <- dplyr::mutate_all(out, "clean_cols") 27 | out <- suppressMessages(readr::type_convert(out)) 28 | 29 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 30 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 31 | 32 | out 33 | 34 | } 35 | -------------------------------------------------------------------------------- /R/utils.r: -------------------------------------------------------------------------------- 1 | make_params <- function(params, by, ok="") { 2 | 3 | by <- stringi::stri_trans_tolower(by) 4 | by <- stringi::stri_replace_all_regex(by, "[[:space:]]", "") 5 | by <- strsplit(by, "")[[1]] 6 | by <- purrr::keep(by, `%in%`, ok) 7 | by <- sort(unique(by)) 8 | 9 | params <- c(params, setNames(as.list(rep("*", length(by))), by)) 10 | 11 | } 12 | 13 | .clean_cols <- function(x) { 14 | 15 | x <- stringi::stri_replace_all_fixed(x, ",", "") 16 | 17 | if (any(grepl("%", x))) { 18 | as.numeric(stringi::stri_replace_all_fixed(x, "%", ""))/100 19 | } else if (any(grepl("\\$", x))) { 20 | as.numeric(stringi::stri_replace_all_fixed(x, "$", "")) 21 | } else { 22 | x 23 | } 24 | 25 | } 26 | 27 | clean_cols <- function(x) { 28 | suppressWarnings( 29 | .clean_cols(x) 30 | ) 31 | } -------------------------------------------------------------------------------- /R/wage_decomposition.r: -------------------------------------------------------------------------------- 1 | #' Retreive Wage Decomposition 2 | #' 3 | #' Wage inequality data shows the overall wage inequality and the within-group and 4 | #' between-group wage inequality over time. These measures allow an examination of how 5 | #' much of the change in overall wage inequality in particular periods was due to changes 6 | #' in within-group and between-group wage inequality. 7 | #' 8 | #' Population sample: Wage and salary workers age 18–64 9 | #' 10 | #' @param by \code{NULL} or character string of \code{g} (Gender) 11 | #' @return \code{tbl_df} with data filtered by the selected criteria. 12 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 13 | #' @note Data source: CPS ORG 14 | #' @return data frame 15 | #' @export 16 | #' @examples 17 | #' get_wages_by_percentile() 18 | #' 19 | #' get_wages_by_percentile("g") 20 | get_wage_decomposition <- function(by=NULL) { 21 | 22 | params <- list(subject="wageineq") 23 | 24 | if (!is.null(by)) { 25 | params <- make_params(params, by, "g") 26 | } 27 | 28 | res <- epi_query(params) 29 | if (is.null(res)) return(data.frame()) 30 | 31 | cols <- stringi::stri_trans_tolower(res$columns$name) 32 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 33 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 34 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 35 | "_") 36 | out <- setNames(as_data_frame(res$data), cols) 37 | out <- dplyr::mutate_all(out, "clean_cols") 38 | out <- suppressMessages(readr::type_convert(out)) 39 | 40 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 41 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 42 | 43 | out 44 | 45 | } 46 | -------------------------------------------------------------------------------- /R/wages.r: -------------------------------------------------------------------------------- 1 | #' Retreive the hourly wage in the middle of the wage distribution 2 | #' 3 | #' The median wage is the hourly wage in the middle of the wage distribution; 4 | #' 50 percent of wage earners earn less and 50 percent earn more. The average wage is 5 | #' the arithmetic mean of hourly wages; or, the sum of all workers' hourly wages divided 6 | #' by the number of workers. 7 | #' 8 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender), 9 | #' \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 10 | #' i.e. if you want to wage data by gender and race, you would set this 11 | #' parameter to "\code{gr}". 12 | #' @return \code{tbl_df} with data filtered by the selected criteria. 13 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 14 | #' @export 15 | #' @examples 16 | #' get_median_and_mean_wages() 17 | #' 18 | #' get_median_and_mean_wages("r") 19 | #' 20 | #' get_median_and_mean_wages("gr") 21 | get_median_and_mean_wages <- function(by=NULL) { 22 | 23 | params <- list(subject="wage-avg") 24 | 25 | if (!is.null(by)) { 26 | params <- make_params(params, by, c("g", "r", "e", "d", "l")) 27 | names(params) <- gsub("^l$", "el", names(params)) 28 | } 29 | 30 | res <- epi_query(params) 31 | if (is.null(res)) return(data.frame()) 32 | 33 | cols <- stringi::stri_trans_tolower(res$columns$name) 34 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 35 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 36 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 37 | "_") 38 | out <- setNames(as_data_frame(res$data), cols) 39 | out <- dplyr::mutate_all(out, "clean_cols") 40 | out <- suppressMessages(readr::type_convert(out)) 41 | 42 | cite <- "Economic Policy Institute" 43 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 44 | 45 | out 46 | 47 | } 48 | 49 | #' Retreive the average hourly wages of workers disaggregated by the highest level of education attained 50 | #' 51 | #' Wages by education are the average hourly wages of workers disaggregated by the highest 52 | #' level of education attained. Employment shares provide the distribution of educational 53 | #' attainment for workers of each gender, racial, and ethnic group as a share of total 54 | #' employed for each group. 55 | #' 56 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender) or 57 | #' \code{r} (Race), i.e. if you want to retrieve 58 | #' unemployment data by gender and race, you would set this parameter to "\code{gr}". 59 | #' @return \code{tbl_df} with data filtered by the selected criteria. 60 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 61 | #' @export 62 | #' @examples 63 | #' get_wages_by_education() 64 | #' 65 | #' get_wages_by_education("r") 66 | #' 67 | #' get_wages_by_education("gr") 68 | get_wages_by_education <- function(by=NULL) { 69 | 70 | params <- list(preset="wage-education") 71 | 72 | if (!is.null(by)) { 73 | params <- make_params(params, by, c("g", "r")) 74 | params <- c(params, list(subject="wage", e="*", d="50,mean", m="share")) 75 | } 76 | 77 | res <- epi_query(params) 78 | if (is.null(res)) return(data.frame()) 79 | 80 | cols <- stringi::stri_trans_tolower(res$columns$name) 81 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 82 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 83 | "_") 84 | out <- setNames(as_data_frame(res$data), cols) 85 | out <- dplyr::mutate_all(out, "clean_cols") 86 | out <- suppressMessages(readr::type_convert(out)) 87 | 88 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 89 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 90 | 91 | out 92 | 93 | } 94 | 95 | #' Retreive wages at ten distinct points in the wage distribution 96 | #' 97 | #' Wage percentiles are wages at ten distinct points in the wage distribution: deciles 98 | #' and the 95th percentile. The 95–50 and 50–10 wage ratios show how much greater wages 99 | #' are at the top than the middle, and at the middle than the bottom, respectively. 100 | #' 101 | #' @param by \code{NULL} or character string with any combination of \code{g} (Gender) or 102 | #' \code{r} (Race), i.e. if you want to retrieve 103 | #' unemployment data by gender and race, you would set this parameter to "\code{gr}". 104 | #' @return \code{tbl_df} with data filtered by the selected criteria. 105 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 106 | #' @return data frame 107 | #' @export 108 | #' @examples 109 | #' get_wages_by_percentile() 110 | #' 111 | #' get_wages_by_percentile("r") 112 | #' 113 | #' get_wages_by_percentile("gr") 114 | get_wages_by_percentile <- function(by=NULL) { 115 | 116 | params <- list(preset="wage-percentiles") 117 | 118 | if (!is.null(by)) { 119 | params <- make_params(params, by, c("g", "r")) 120 | params <- c(params, list(subject="wage", d="*")) 121 | } 122 | 123 | res <- epi_query(params) 124 | if (is.null(res)) return(data.frame()) 125 | 126 | cols <- stringi::stri_trans_tolower(res$columns$name) 127 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 128 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 129 | "_") 130 | out <- setNames(as_data_frame(res$data), cols) 131 | out <- dplyr::mutate_all(out, "clean_cols") 132 | out <- suppressMessages(readr::type_convert(out)) 133 | 134 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 135 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 136 | 137 | out 138 | 139 | } 140 | -------------------------------------------------------------------------------- /R/wages_and_hours.r: -------------------------------------------------------------------------------- 1 | #' Retreive CPS ASEC Annual Wages and Work Hours 2 | #' 3 | #' Annual, weekly, and hourly wages and work hours show the average wages and work hours 4 | #' of wage and salary workers using data from the CPS ASEC (also known as the March CPS). 5 | #' Note that this data is not directly comparable to the CPS ORG data in median/average 6 | #' hourly wage. 7 | #' 8 | #' @return \code{tbl_df} 9 | #' @references \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 10 | #' @note CPS ASEC | Murphy and Welch (1989) 11 | #' @return data frame 12 | #' @export 13 | #' @examples 14 | #' get_annual_wages_and_work_hours() 15 | get_annual_wages_and_work_hours <- function() { 16 | 17 | params <- list(subject="hours") 18 | 19 | res <- epi_query(params) 20 | if (is.null(res)) return(data.frame()) 21 | 22 | cols <- stringi::stri_trans_tolower(res$columns$name) 23 | cols <- stringi::stri_replace_all_regex(cols, "[\\('\\)]", "") 24 | cols <- stringi::stri_replace_all_regex(cols, "[[:space:]" %s+% 25 | rawToChar(as.raw(c(0xe2, 0x80, 0x93))) %s+% "-]+", 26 | "_") 27 | out <- setNames(as_data_frame(res$data), cols) 28 | out <- dplyr::mutate_all(out, "clean_cols") 29 | out <- suppressMessages(readr::type_convert(out)) 30 | 31 | cite <- html_text(read_html(res$meta$source %||% "

Economic Policy Institute

")) 32 | message(sprintf('Note: %s\nCitation: "%s"', res$meta$notes %||% "None", cite)) 33 | 34 | out 35 | 36 | } 37 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: rmarkdown::github_document 3 | editor_options: 4 | chunk_output_type: console 5 | --- 6 | ```{r pkg-knitr-opts, include=FALSE} 7 | hrbrpkghelpr::global_opts() 8 | ``` 9 | 10 | ```{r badges, results='asis', echo=FALSE, cache=FALSE} 11 | hrbrpkghelpr::stinking_badges() 12 | ``` 13 | 14 | ```{r description, results='asis', echo=FALSE, cache=FALSE} 15 | hrbrpkghelpr::yank_title_and_description() 16 | ``` 17 | 18 | ## What's Inside The Tin 19 | 20 | The following functions are implemented: 21 | 22 | ```{r ingredients, results='asis', echo=FALSE, cache=FALSE} 23 | hrbrpkghelpr::describe_ingredients() 24 | ``` 25 | 26 | ## Installation 27 | 28 | ```{r install-ex, results='asis', echo=FALSE, cache=FALSE} 29 | hrbrpkghelpr::install_block() 30 | ``` 31 | 32 | ## Usage 33 | 34 | ```{r lib-ex} 35 | library(epidata) 36 | 37 | # current version 38 | packageVersion("epidata") 39 | 40 | ``` 41 | 42 | ```{r ex01} 43 | get_black_white_wage_gap() 44 | 45 | get_underemployment() 46 | 47 | get_median_and_mean_wages("gr") 48 | ``` 49 | 50 | ## Extended Example 51 | 52 | ```{r fig.width=10, fig.height=8, fig.retina=2} 53 | library(tidyverse) 54 | library(epidata) 55 | library(ggrepel) 56 | library(hrbrthemes) 57 | 58 | unemployment <- get_unemployment() 59 | wages <- get_median_and_mean_wages() 60 | 61 | glimpse(wages) 62 | 63 | glimpse(unemployment) 64 | 65 | unemployment %>% 66 | group_by(date = as.integer(lubridate::year(date))) %>% 67 | summarise(rate = mean(all)) %>% 68 | left_join(select(wages, date, median), by = "date") %>% 69 | filter(!is.na(median)) %>% 70 | arrange(date) -> xdf 71 | 72 | cols <- ggthemes::tableau_color_pal()(3) 73 | 74 | update_geom_font_defaults(font_rc) 75 | 76 | ggplot(xdf, aes(rate, median)) + 77 | geom_path( 78 | color = cols[1], 79 | arrow = arrow( 80 | type = "closed", 81 | length = unit(10, "points") 82 | ) 83 | ) + 84 | geom_point() + 85 | geom_label_repel( 86 | aes(label = date), 87 | alpha = c(1, rep((4/5), (nrow(xdf)-2)), 1), 88 | size = c(5, rep(3, (nrow(xdf)-2)), 5), 89 | color = c(cols[2], rep("#2b2b2b", (nrow(xdf)-2)), cols[3]), 90 | family = font_rc 91 | ) + 92 | scale_x_continuous( 93 | name = "Unemployment Rate", 94 | expand = c(0,0.001), label = scales::percent 95 | ) + 96 | scale_y_continuous( 97 | name = "Median Wage", 98 | expand = c(0,0.25), 99 | label = scales::dollar 100 | ) + 101 | labs( 102 | title = "U.S. Unemployment Rate vs Median Wage Since 1978", 103 | subtitle = "Wage data is in 2015 USD", 104 | caption = "Source: EPI analysis of Current Population Survey Outgoing Rotation Group microdata" 105 | ) + 106 | theme_ipsum_rc(grid="XY") 107 | ``` 108 | 109 | ## epidata Metrics 110 | 111 | ```{r cloc, echo=FALSE} 112 | cloc::cloc_pkg_md() 113 | ``` 114 | 115 | ## Code of Conduct 116 | 117 | Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Project Status: Active – The project has reached a stable, usable 3 | state and is being actively 4 | developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) 5 | [![Signed 6 | by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr) 7 | ![Signed commit 8 | %](https://img.shields.io/badge/Signed_Commits-36%25-lightgrey.svg) 9 | [![Linux build 10 | Status](https://travis-ci.org/hrbrmstr/epidata.svg?branch=master)](https://travis-ci.org/hrbrmstr/epidata) 11 | [![Coverage 12 | Status](https://codecov.io/gh/hrbrmstr/epidata/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/epidata) 13 | [![cran 14 | checks](https://cranchecks.info/badges/worst/epidata)](https://cranchecks.info/pkgs/epidata) 15 | [![CRAN 16 | status](https://www.r-pkg.org/badges/version/epidata)](https://www.r-pkg.org/pkg/epidata) 17 | ![Minimal R 18 | Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg) 19 | ![License](https://img.shields.io/badge/License-AGPL-blue.svg) 20 | 21 | # epidata 22 | 23 | Tools to Retrieve Economic Policy Institute Data Library Extracts 24 | 25 | ## Description 26 | 27 | The Economic Policy Institute () provides 28 | researchers, media, and the public with easily accessible, up-to-date, 29 | and comprehensive historical data on the American labor force. It is 30 | compiled from Economic Policy Institute analysis of government data 31 | sources. Use it to research wages, inequality, and other economic 32 | indicators over time and among demographic groups. Data is usually 33 | updated monthly. 34 | 35 | ## What’s Inside The Tin 36 | 37 | The following functions are implemented: 38 | 39 | - `get_annual_wages_and_work_hours`: Retreive CPS ASEC Annual Wages 40 | and Work Hours 41 | - `get_annual_wages_by_wage_group`: Annual wages by wage group 42 | - `get_black_white_wage_gap`: Retreive the percent by which hourly 43 | wages of black workers are less than hourly wages of white workers 44 | - `get_college_wage_premium`: Retreive the percent by which hourly 45 | wages of college graduates exceed those of otherwise equivalent high 46 | school graduates 47 | - `get_compensation_wages_and_benefits`: Compensation, wages, and 48 | benefits 49 | - `get_employment_to_population_ratio`: Retreive the share of the 50 | civilian noninstitutional population that is employed 51 | - `get_gender_wage_gap`: Retreive the percent by which hourly wages of 52 | female workers are less than hourly wages of male workers 53 | - `get_health_insurance_coverage`: Retreive Health Insurance Coverage 54 | - `get_hispanic_white_wage_gap`: Retreive the percent by which hourly 55 | wages of Hispanic workers are less than hourly wages of white 56 | workers 57 | - `get_labor_force_participation_rate`: Retreive the share of the 58 | civilian noninstitutional population that is in the labor force 59 | - `get_long_term_unemployment`: Retreive the share of the labor force 60 | that has been unemployed for six months or longer 61 | - `get_median_and_mean_wages`: Retreive the hourly wage in the middle 62 | of the wage distribution 63 | - `get_minimum_wage`: Minimum wage 64 | - `get_non_high_school_wage_penalty`: Retreive the percent by which 65 | hourly wages of workers without a high school diploma (or 66 | equivalent) are less than wages of otherwise equivalent workers who 67 | have graduated from high school 68 | - `get_pension_coverage`: Retreive Pension Coverage 69 | - `get_poverty_level_wages`: Poverty-level wages 70 | - `get_productivity_and_hourly_compensation`: Retreive Productivity 71 | and hourly compensation 72 | - `get_underemployment`: Retreive the share of the labor force that is 73 | “underemployed” 74 | - `get_unemployment_by_state`: Retreive the share of the labor force 75 | without a job (by state) 76 | - `get_unemployment`: Retreive the share of the labor force without a 77 | job 78 | - `get_union_coverage`: Retreive Union Coverage 79 | - `get_wage_decomposition`: Retreive Wage Decomposition 80 | - `get_wage_ratios`: Retreive the level of inequality within the 81 | hourly wage distribution. 82 | - `get_wages_by_education`: Retreive the average hourly wages of 83 | workers disaggregated by the highest level of education attained 84 | - `get_wages_by_percentile`: Retreive wages at ten distinct points in 85 | the wage distribution 86 | - `not_dos`: Not DoS’ing EPI/Cloudflare 87 | 88 | ## Installation 89 | 90 | ``` r 91 | install.packages("epidata") # NOTE: CRAN version is 0.3.0 92 | # or 93 | install.packages("epidata", repos = c("https://cinc.rud.is", "https://cloud.r-project.org/")) 94 | # or 95 | remotes::install_git("https://git.sr.ht/~hrbrmstr/epidata") 96 | # or 97 | remotes::install_gitlab("hrbrmstr/epidata") 98 | # or 99 | remotes::install_github("hrbrmstr/epidata") 100 | ``` 101 | 102 | NOTE: To use the ‘remotes’ install options you will need to have the 103 | [{remotes} package](https://github.com/r-lib/remotes) installed. 104 | 105 | ## Usage 106 | 107 | ``` r 108 | library(epidata) 109 | 110 | # current version 111 | packageVersion("epidata") 112 | ## [1] '0.4.0' 113 | ``` 114 | 115 | ``` r 116 | get_black_white_wage_gap() 117 | ## # A tibble: 47 x 8 118 | ## date white_median white_average black_median black_average gap_median gap_average gap_regression_based 119 | ## 120 | ## 1 1973 17.9 20.7 14.0 16.3 0.223 0.215 NA 121 | ## 2 1974 17.5 20.3 14.0 16.0 0.198 0.209 NA 122 | ## 3 1975 17.4 20.4 14.1 16.1 0.191 0.208 NA 123 | ## 4 1976 17.5 20.5 14.2 16.8 0.19 0.182 NA 124 | ## 5 1977 17.5 20.4 14.2 16.5 0.188 0.19 NA 125 | ## 6 1978 17.7 20.5 14.2 16.7 0.201 0.186 NA 126 | ## 7 1979 17.4 20.7 14.6 17.1 0.164 0.173 0.086 127 | ## 8 1980 17.4 20.3 14.4 16.7 0.173 0.174 0.086 128 | ## 9 1981 17.0 20.2 14.0 16.6 0.175 0.174 0.0820 129 | ## 10 1982 17.2 20.4 13.9 16.5 0.194 0.191 0.099 130 | ## # … with 37 more rows 131 | 132 | get_underemployment() 133 | ## # A tibble: 367 x 2 134 | ## date all 135 | ## 136 | ## 1 1989-12-01 0.094 137 | ## 2 1990-01-01 0.093 138 | ## 3 1990-02-01 0.094 139 | ## 4 1990-03-01 0.094 140 | ## 5 1990-04-01 0.094 141 | ## 6 1990-05-01 0.094 142 | ## 7 1990-06-01 0.094 143 | ## 8 1990-07-01 0.094 144 | ## 9 1990-08-01 0.095 145 | ## 10 1990-09-01 0.096 146 | ## # … with 357 more rows 147 | 148 | get_median_and_mean_wages("gr") 149 | ## # A tibble: 47 x 25 150 | ## date median average men_median men_average women_median women_average white_median white_average black_median 151 | ## 152 | ## 1 1973 17.3 20.1 21.0 23.6 13.2 15.1 17.9 20.7 14.0 153 | ## 2 1974 16.9 19.7 20.7 23.1 13 14.9 17.5 20.3 14.0 154 | ## 3 1975 16.9 19.8 21.0 23.1 13.2 15.1 17.4 20.4 14.1 155 | ## 4 1976 16.9 20.0 20.7 23.4 13.3 15.4 17.5 20.5 14.2 156 | ## 5 1977 16.9 19.9 20.9 23.4 13.2 15.2 17.5 20.4 14.2 157 | ## 6 1978 17.1 19.9 21.2 23.5 13.2 15.3 17.7 20.5 14.2 158 | ## 7 1979 16.8 20.1 21.1 23.7 13.4 15.5 17.4 20.7 14.6 159 | ## 8 1980 16.7 19.7 20.9 23.2 13.3 15.3 17.4 20.3 14.4 160 | ## 9 1981 16.5 19.6 20.4 23.0 13.4 15.3 17.0 20.2 14.0 161 | ## 10 1982 16.4 19.8 20.4 23.2 13.2 15.6 17.2 20.4 13.9 162 | ## # … with 37 more rows, and 15 more variables: black_average , hispanic_median , hispanic_average , 163 | ## # white_men_median , white_men_average , black_men_median , black_men_average , 164 | ## # hispanic_men_median , hispanic_men_average , white_women_median , white_women_average , 165 | ## # black_women_median , black_women_average , hispanic_women_median , hispanic_women_average 166 | ``` 167 | 168 | ## Extended Example 169 | 170 | ``` r 171 | library(tidyverse) 172 | library(epidata) 173 | library(ggrepel) 174 | library(hrbrthemes) 175 | 176 | unemployment <- get_unemployment() 177 | wages <- get_median_and_mean_wages() 178 | 179 | glimpse(wages) 180 | ## Rows: 47 181 | ## Columns: 3 182 | ## $ date 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989,… 183 | ## $ median 17.27, 16.93, 16.94, 16.90, 16.92, 17.07, 16.79, 16.68, 16.50, 16.43, 16.47, 16.55, 16.81, 16.92, 17.… 184 | ## $ average 20.09, 19.72, 19.77, 19.99, 19.88, 19.92, 20.10, 19.70, 19.59, 19.76, 19.80, 19.87, 20.08, 20.57, 20.… 185 | 186 | glimpse(unemployment) 187 | ## Rows: 510 188 | ## Columns: 2 189 | ## $ date 1978-01-01, 1978-02-01, 1978-03-01, 1978-04-01, 1978-05-01, 1978-06-01, 1978-07-01, 1978-08-01, 1978-09… 190 | ## $ all NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0.061, 0.061, 0.060, 0.060, 0.059, 0.059, 0.059, 0.058, 0.05… 191 | 192 | unemployment %>% 193 | group_by(date = as.integer(lubridate::year(date))) %>% 194 | summarise(rate = mean(all)) %>% 195 | left_join(select(wages, date, median), by = "date") %>% 196 | filter(!is.na(median)) %>% 197 | arrange(date) -> xdf 198 | 199 | cols <- ggthemes::tableau_color_pal()(3) 200 | 201 | update_geom_font_defaults(font_rc) 202 | 203 | ggplot(xdf, aes(rate, median)) + 204 | geom_path( 205 | color = cols[1], 206 | arrow = arrow( 207 | type = "closed", 208 | length = unit(10, "points") 209 | ) 210 | ) + 211 | geom_point() + 212 | geom_label_repel( 213 | aes(label = date), 214 | alpha = c(1, rep((4/5), (nrow(xdf)-2)), 1), 215 | size = c(5, rep(3, (nrow(xdf)-2)), 5), 216 | color = c(cols[2], rep("#2b2b2b", (nrow(xdf)-2)), cols[3]), 217 | family = font_rc 218 | ) + 219 | scale_x_continuous( 220 | name = "Unemployment Rate", 221 | expand = c(0,0.001), label = scales::percent 222 | ) + 223 | scale_y_continuous( 224 | name = "Median Wage", 225 | expand = c(0,0.25), 226 | label = scales::dollar 227 | ) + 228 | labs( 229 | title = "U.S. Unemployment Rate vs Median Wage Since 1978", 230 | subtitle = "Wage data is in 2015 USD", 231 | caption = "Source: EPI analysis of Current Population Survey Outgoing Rotation Group microdata" 232 | ) + 233 | theme_ipsum_rc(grid="XY") 234 | ``` 235 | 236 | 237 | 238 | ## epidata Metrics 239 | 240 | | Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | 241 | | :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: | 242 | | R | 18 | 0.47 | 516 | 0.45 | 205 | 0.44 | 508 | 0.47 | 243 | | Rmd | 1 | 0.03 | 58 | 0.05 | 27 | 0.06 | 32 | 0.03 | 244 | | SUM | 19 | 0.50 | 574 | 0.50 | 232 | 0.50 | 540 | 0.50 | 245 | 246 | clock Package Metrics for epidata 247 | 248 | ## Code of Conduct 249 | 250 | Please note that this project is released with a Contributor Code of 251 | Conduct. By participating in this project you agree to abide by its 252 | terms. 253 | -------------------------------------------------------------------------------- /README_files/figure-gfm/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/epidata/dc17d09a82427dfd2aadefdc7701fe872c6b320a/README_files/figure-gfm/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | * local OS X install, R 3.5.3 3 | * ubuntu 14.04 (on travis-ci), R 3.5.3 4 | * win-builder (devel and release) 5 | * r-hub (windows) (devel and release) 6 | 7 | ## R CMD check results 8 | 9 | 0 errors | 0 warnings | 1 note 10 | 11 | * the usual maintainer note 12 | 13 | Per Kurt's email I have fixed the CRAN check issues. I have 14 | also added four new functions (for four new API endpoints), 15 | changed out http: URLS in the documentation to https: 16 | and re-generated all documentation and README files. 17 | 18 | Thx, as always, for your combined diligence! 19 | -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Authors • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 |
    81 |
  • 82 |

    Bob Rudis. Author, maintainer. 83 |

    84 |
  • 85 |
86 | 87 |
88 | 89 |
90 | 91 | 92 |
93 | 96 | 97 |
98 |

Site built with pkgdown.

99 |
100 | 101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/jquery.sticky-kit.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net 3 | */ 4 | (function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); 5 | if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, 6 | u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), 8 | a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", 9 | y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/news/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | All news • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 | 76 |
77 | 80 | 81 |
82 |
83 |
84 | 85 | 92 | 93 |
94 | 95 |
96 | 99 | 100 |
101 |

Site built with pkgdown.

102 |
103 | 104 |
105 |
106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/pkgdown.css: -------------------------------------------------------------------------------- 1 | /* Sticker footer */ 2 | body > .container { 3 | display: flex; 4 | padding-top: 60px; 5 | min-height: calc(100vh); 6 | flex-direction: column; 7 | } 8 | 9 | body > .container .row { 10 | flex: 1; 11 | } 12 | 13 | footer { 14 | margin-top: 45px; 15 | padding: 35px 0 36px; 16 | border-top: 1px solid #e5e5e5; 17 | color: #666; 18 | display: flex; 19 | } 20 | footer p { 21 | margin-bottom: 0; 22 | } 23 | footer div { 24 | flex: 1; 25 | } 26 | footer .pkgdown { 27 | text-align: right; 28 | } 29 | footer p { 30 | margin-bottom: 0; 31 | } 32 | 33 | img.icon { 34 | float: right; 35 | } 36 | 37 | /* Section anchors ---------------------------------*/ 38 | 39 | .hasAnchor { 40 | margin-left: -30px; 41 | } 42 | 43 | a.anchor { 44 | display:inline-block; 45 | width: 30px; 46 | height: 30px; 47 | visibility: hidden; 48 | 49 | background-image: url(./link.svg); 50 | background-repeat: no-repeat; 51 | background-size: 20px 20px; 52 | background-position: center center; 53 | } 54 | 55 | .hasAnchor:hover a.anchor { 56 | visibility: visible; 57 | } 58 | 59 | /* Fixes for fixed navbar --------------------------*/ 60 | 61 | .contents h1, .contents h2, .contents h3, .contents h4 { 62 | padding-top: 60px; 63 | margin-top: -60px; 64 | } 65 | 66 | /* Sidebar --------------------------*/ 67 | 68 | #sidebar { 69 | margin-top: 30px; 70 | } 71 | #sidebar h2 { 72 | font-size: 1.5em; 73 | margin-top: 1em; 74 | } 75 | 76 | #sidebar h2:first-child { 77 | margin-top: 0; 78 | } 79 | 80 | #sidebar .list-unstyled li { 81 | margin-bottom: 0.5em; 82 | } 83 | 84 | /* Syntax highlighting ---------------------------------------------------- */ 85 | 86 | code { 87 | background-color: #f7f7f7; 88 | color: #333; 89 | } 90 | code a { 91 | color: #375f84; 92 | } 93 | 94 | .warning { color: red; } 95 | .message { font-weight: bolder; } 96 | .error { color: red; font-weight: bolder; } 97 | 98 | .fl,.number {color:rgb(21,20,181);} 99 | .fu,.functioncall {color:#264D66 ;} 100 | .ch,.st,.string {color:#375D81 ;} 101 | .kw,.keyword {color:black;} 102 | .argument {color:#264D66 ;} 103 | .co,.comment {color: #777;} 104 | .formalargs {color: #264D66;} 105 | .eqformalargs {color:#264D66;} 106 | .slot {font-style:italic;} 107 | .symbol {color:black ;} 108 | .prompt {color:black ;} 109 | 110 | pre img { 111 | background-color: #fff; 112 | display: block; 113 | } 114 | -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $("#sidebar").stick_in_parent({offset_top: 40}); 3 | $('body').scrollspy({ 4 | target: '#sidebar', 5 | offset: 60 6 | }); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /docs/reference/epidata.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A package to Tools to Retrieve Economic Policy Institute Data Library Extracts — epidata • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The Economic Policy Institute provides researchers, media, and the public with easily 82 | accessible, up-to-date, and comprehensive historical data on the American labor force. 83 | It is compiled from Economic Policy Institute analysis of government data sources. Use 84 | it to research wages, inequality, and other economic indicators over time and among 85 | demographic groups. Data is usually updated monthly.

86 | 87 | 88 | 89 | 90 |
91 | 101 |
102 | 103 |
104 | 107 | 108 |
109 |

Site built with pkgdown.

110 |
111 | 112 |
113 |
114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /docs/reference/get_black_white_wage_gap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the percent by which hourly wages of black workers are less than hourly wages of white workers — get_black_white_wage_gap • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The black-white wage gap is the percent by which hourly wages of black workers are less 82 | than hourly wages of white workers. It is also often expressed as a wage ratio (black 83 | workers' share of white workers' wages) by subtracting the gap from 100 percent.

84 | 85 | 86 |
get_black_white_wage_gap(by = NULL)
87 | 88 |

Arguments

89 |
90 |
by
91 |
NULL or g for a parition by gender
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

Details

99 | 100 |

    101 |
  • A median black-white wage gap of 26.2 percent means that a typical black worker 102 | is paid 26.2 percent less per hour than a typical white worker. 103 |
  • 104 |
  • An average black-white wage gap of 26.6 percent means that on average black 105 | workers are paid 26.6 percent less per hour than white workers. 106 |
  • 107 |
  • A regression-based black-white wage gap of 15.2 percent means that on average 108 | black workers are paid 15.2 percent less per hour than white workers, all else 109 | held equal (controlling for gender, race and ethnicity, education, experience, 110 | and geographic location). 111 |
  • 112 |

113 | 114 |

References

115 | 116 |

http://www.epi.org/data/

117 | 118 | 119 |

Examples

120 |
## Not run: ------------------------------------ 121 | # get_black_white_wage_gap() 122 | # 123 | # get_black_white_wage_gap("g") 124 | ## ---------------------------------------------
125 |
126 | 141 |
142 | 143 |
144 | 147 | 148 |
149 |

Site built with pkgdown.

150 |
151 | 152 |
153 |
154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /docs/reference/get_college_wage_premium.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the percent by which hourly wages of college graduates exceed those of otherwise 10 | — get_college_wage_premium • epidata 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 |
39 |
40 | 71 | 72 | 73 |
74 | 75 |
76 |
77 | 81 | 82 | 83 |

A regression-based college wage premium of 56.1 percent means that on average workers 84 | with a college degree are paid 56.1 percent more per hour than workers whose highest 85 | education credential is a high school diploma, all else held equal (controlling for 86 | gender, race and ethnicity, education, experience, and geographic location).

87 | 88 | 89 |
get_college_wage_premium(by = NULL)
90 | 91 |

Arguments

92 |
93 |
by
94 |
NULL or g for a parition by gender
95 |
96 | 97 |

Value

98 | 99 |

tbl_df with data filtered by the selected criteria.

100 | 101 |

References

102 | 103 |

http://www.epi.org/data/

104 | 105 | 106 |

Examples

107 |
## Not run: ------------------------------------ 108 | # get_college_wage_premium() 109 | # 110 | # get_college_wage_premium("g") 111 | ## ---------------------------------------------
112 |
113 | 126 |
127 | 128 |
129 | 132 | 133 |
134 |

Site built with pkgdown.

135 |
136 | 137 |
138 |
139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /docs/reference/get_employment_to_population_ratio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the civilian noninstitutional population that is employed — get_employment_to_population_ratio • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Retreive the share of the civilian noninstitutional population that is employed

82 | 83 | 84 |
get_employment_to_population_ratio(by = NULL)
85 | 86 |

Arguments

87 |
88 |
by
89 |
NULL or character string with any combination of g (Gender), 90 | r (Race), a (Age), e (Education). i.e. if you want to retrieve 91 | unemployment data by gender, race and education, you would set this parameter to "gre".
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

References

99 | 100 |

http://www.epi.org/data/

101 | 102 | 103 |

Examples

104 |
## Not run: ------------------------------------ 105 | # get_employment_to_population_ratio() 106 | # 107 | # get_employment_to_population_ratio("r") 108 | # 109 | # get_employment_to_population_ratio("grae") 110 | ## ---------------------------------------------
111 |
112 | 125 |
126 | 127 |
128 | 131 | 132 |
133 |

Site built with pkgdown.

134 |
135 | 136 |
137 |
138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /docs/reference/get_gender_wage_gap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the percent by which hourly wages of female workers are less than hourly wages of male workers — get_gender_wage_gap • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The gender wage gap is the percent by which hourly wages of female workers are less than 82 | hourly wages of male workers. It is also often expressed as a wage ratio (women's 83 | share of men's wages) by subtracting the gap from 100 percent.

84 | 85 | 86 |
get_gender_wage_gap(by = NULL)
87 | 88 |

Arguments

89 |
90 |
by
91 |
NULL or r for a parition by race
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

Details

99 | 100 |

    101 |
  • A median gender wage gap of 17.3 percent means that a typical woman is paid 17.3 102 | percent less per hour than a typical man. 103 |
  • 104 |
  • An average gender wage gap of 19.7 percent means that on average women are paid 105 | 19.7 percent less per hour than men. 106 |
  • 107 |
  • A regression-based gender wage gap of 21.7 percent means that on average women 108 | are paid 21.7 percent less per hour than men, all else held equal (controlling for 109 | gender, race and ethnicity, education, experience, and geographic location). 110 |
  • 111 |

112 | 113 |

References

114 | 115 |

http://www.epi.org/data/

116 | 117 | 118 |

Examples

119 |
## Not run: ------------------------------------ 120 | # get_gender_wage_gap() 121 | # 122 | # get_gender_wage_gap("r") 123 | ## ---------------------------------------------
124 |
125 | 140 |
141 | 142 |
143 | 146 | 147 |
148 |

Site built with pkgdown.

149 |
150 | 151 |
152 |
153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/get_hispanic_white_wage_gap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the percent by which hourly wages of Hispanic workers are less than hourly wages of white workers — get_hispanic_white_wage_gap • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The Hispanic-white wage gap is the percent by which hourly wages of Hispanic workers 82 | are less than hourly wages of white workers. It is also often expressed as a wage ratio 83 | (Hispanic workers' share of white workers' wages) by subtracting the gap from 100 percent.

84 | 85 | 86 |
get_hispanic_white_wage_gap(by = NULL)
87 | 88 |

Arguments

89 |
90 |
by
91 |
NULL or g for a parition by gender
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

Details

99 | 100 |

    101 |
  • A median Hispanic-white wage gap of 29.6 percent means that a typical Hispanic 102 | worker is paid 29.6 percent less per hour than a typical white worker. 103 |
  • 104 |
  • An average Hispanic-white wage gap of 30.1 percent means that on average Hispanic 105 | workers are paid 30.1 percent less per hour than white workers. 106 |
  • 107 |
  • A regression-based Hispanic-white wage gap of 11.1 percent means that on average 108 | Hispanic workers are paid 11.1 percent less per hour than white workers, all 109 | else held equal (controlling for gender, race and ethnicity, education, 110 | experience, and geographic location). 111 |
  • 112 |

113 | 114 |

References

115 | 116 |

http://www.epi.org/data/

117 | 118 | 119 |

Examples

120 |
## Not run: ------------------------------------ 121 | # get_hispanic_white_wage_gap() 122 | # 123 | # get_hispanic_white_wage_gap("g") 124 | ## ---------------------------------------------
125 |
126 | 141 |
142 | 143 |
144 | 147 | 148 |
149 |

Site built with pkgdown.

150 |
151 | 152 |
153 |
154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /docs/reference/get_labor_force_participation_rate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the civilian noninstitutional population that is in the labor force — get_labor_force_participation_rate • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

(i.e., working or looking for work)

82 | 83 | 84 |
get_labor_force_participation_rate(by = NULL)
85 | 86 |

Arguments

87 |
88 |
by
89 |
NULL or character string with any combination of g (Gender), 90 | r (Race), a (Age), e (Education). i.e. if you want to retrieve 91 | unemployment data by gender, race and education, you would set this parameter to "gre".
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

References

99 | 100 |

http://www.epi.org/data/

101 | 102 | 103 |

Examples

104 |
## Not run: ------------------------------------ 105 | # get_labor_force_participation_rate() 106 | # 107 | # get_labor_force_participation_rate("r") 108 | # 109 | # get_labor_force_participation_rate("grae") 110 | ## ---------------------------------------------
111 |
112 | 125 |
126 | 127 |
128 | 131 | 132 |
133 |

Site built with pkgdown.

134 |
135 | 136 |
137 |
138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /docs/reference/get_long_term_unemployment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the labor force that has been unemployed for six months or longer — get_long_term_unemployment • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Retreive the share of the labor force that has been unemployed for six months or longer

82 | 83 | 84 |
get_long_term_unemployment(by = NULL)
85 | 86 |

Arguments

87 |
88 |
by
89 |
NULL or character string with any combination of g (Gender), 90 | r (Race), a (Age), e (Education). i.e. if you want to retrieve 91 | unemployment data by gender, race and education, you would set this parameter to "gre".
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

References

99 | 100 |

http://www.epi.org/data/

101 | 102 | 103 |

Examples

104 |
## Not run: ------------------------------------ 105 | # get_long_term_unemployment() 106 | # 107 | # get_long_term_unemployment("r") 108 | # 109 | # get_long_term_unemployment("grae") 110 | ## ---------------------------------------------
111 |
112 | 125 |
126 | 127 |
128 | 131 | 132 |
133 |

Site built with pkgdown.

134 |
135 | 136 |
137 |
138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /docs/reference/get_median_and_mean_wages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the hourly wage in the middle of the wage distribution — get_median_and_mean_wages • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The median wage is the hourly wage in the middle of the wage distribution; 82 | 50 percent of wage earners earn less and 50 percent earn more. The average wage is 83 | the arithmetic mean of hourly wages; or, the sum of all workers' hourly wages divided 84 | by the number of workers.

85 | 86 | 87 |
get_median_and_mean_wages(by = NULL)
88 | 89 |

Arguments

90 |
91 |
by
92 |
NULL or character string with any combination of g (Gender) or 93 | r (Race), i.e. if you want to retrieve 94 | unemployment data by gender and race, you would set this parameter to "gr".
95 |
96 | 97 |

Value

98 | 99 |

tbl_df with data filtered by the selected criteria.

100 | 101 |

References

102 | 103 |

http://www.epi.org/data/

104 | 105 | 106 |

Examples

107 |
## Not run: ------------------------------------ 108 | # get_median_and_mean_wages() 109 | # 110 | # get_median_and_mean_wages("r") 111 | # 112 | # get_median_and_mean_wages("gr") 113 | ## ---------------------------------------------
114 |
115 | 128 |
129 | 130 |
131 | 134 | 135 |
136 |

Site built with pkgdown.

137 |
138 | 139 |
140 |
141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /docs/reference/get_non_high_school_wage_penalty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the percent by which hourly wages of workers without a high school diploma 10 | — get_non_high_school_wage_penalty • epidata 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 |
39 |
40 | 71 | 72 | 73 |
74 | 75 |
76 |
77 | 81 | 82 | 83 |

A regression-based non-high school wage penalty of 21.8 percent means that on average 84 | workers without a high school diploma are paid 21.8 percent less per hour than workers 85 | with a high school diploma, all else held equal (controlling for gender, race and 86 | ethnicity, education, experience, and geographic location).

87 | 88 | 89 |
get_non_high_school_wage_penalty(by = NULL)
90 | 91 |

Arguments

92 |
93 |
by
94 |
NULL or g for a parition by gender
95 |
96 | 97 |

Value

98 | 99 |

tbl_df with data filtered by the selected criteria.

100 | 101 |

References

102 | 103 |

http://www.epi.org/data/

104 | 105 | 106 |

Examples

107 |
## Not run: ------------------------------------ 108 | # get_non_high_school_wage_penalty() 109 | # 110 | # get_non_high_school_wage_penalty("g") 111 | ## ---------------------------------------------
112 |
113 | 126 |
127 | 128 |
129 | 132 | 133 |
134 |

Site built with pkgdown.

135 |
136 | 137 |
138 |
139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /docs/reference/get_underemployment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the labor force that is "underemployed" — get_underemployment • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Underemployment is the share of the labor force that either 1) is unemployed, 2) is 82 | working part time but wants and is available to work full time (an "involuntary" part 83 | timer), or 3) wants and is available to work and has looked for work in the last year 84 | but has given up actively seeking work in the last four weeks ("marginally attached" 85 | worker).

86 | 87 | 88 |
get_underemployment(by = NULL)
89 | 90 |

Arguments

91 |
92 |
by
93 |
NULL or character string with any combination of g (Gender), 94 | r (Race), a (Age), e (Education). i.e. if you want to retrieve 95 | unemployment data by gender, race and education, you would set this parameter to "gre".
96 |
97 | 98 |

Value

99 | 100 |

tbl_df with data filtered by the selected criteria.

101 | 102 |

References

103 | 104 |

http://www.epi.org/data/

105 | 106 | 107 |

Examples

108 |
## Not run: ------------------------------------ 109 | # get_underemployment() 110 | # 111 | # get_underemployment("r") 112 | # 113 | # get_underemployment("grae") 114 | ## ---------------------------------------------
115 |
116 | 129 |
130 | 131 |
132 | 135 | 136 |
137 |

Site built with pkgdown.

138 |
139 | 140 |
141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /docs/reference/get_unemployment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the labor force without a job — get_unemployment • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Retreive the share of the labor force without a job

82 | 83 | 84 |
get_unemployment(by = NULL)
85 | 86 |

Arguments

87 |
88 |
by
89 |
NULL or character string with any combination of g (Gender), 90 | r (Race), a (Age), e (Education). i.e. if you want to retrieve 91 | unemployment data by gender, race and education, you would set this parameter to "gre".
92 |
93 | 94 |

Value

95 | 96 |

tbl_df with data filtered by the selected criteria.

97 | 98 |

Note

99 | 100 |

See get_unemployment_by_state() for information on retrieving unemployment by state+race.

101 | 102 |

References

103 | 104 |

http://www.epi.org/data/

105 | 106 | 107 |

Examples

108 |
## Not run: ------------------------------------ 109 | # get_unemployment() 110 | # 111 | # get_unemployment("r") 112 | # 113 | # get_unemployment("grae") 114 | ## ---------------------------------------------
115 |
116 | 131 |
132 | 133 |
134 | 137 | 138 |
139 |

Site built with pkgdown.

140 |
141 | 142 |
143 |
144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /docs/reference/get_unemployment_by_state.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the share of the labor force without a job (by state) — get_unemployment_by_state • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Retreive the share of the labor force without a job (by state)

82 | 83 | 84 |
get_unemployment_by_state(by = NULL)
85 | 86 |

Arguments

87 |
88 |
by
89 |
NULL or r for a partition by race.
90 |
91 | 92 |

Value

93 | 94 |

tbl_df with data filtered by the selected criteria.

95 | 96 |

Note

97 | 98 |

See get_unemployment() for other unemployment extracts..

99 | 100 |

References

101 | 102 |

http://www.epi.org/data/

103 | 104 | 105 |

Examples

106 |
## Not run: ------------------------------------ 107 | # get_unemployment_by_state() 108 | # 109 | # get_unemployment_by_state("r") 110 | ## ---------------------------------------------
111 |
112 | 127 |
128 | 129 |
130 | 133 | 134 |
135 |

Site built with pkgdown.

136 |
137 | 138 |
139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/reference/get_wage_ratios.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the level of inequality within the hourly wage distribution. — get_wage_ratios • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

The 95–50 and 50–10 wage ratios are representations of the level of inequality within 82 | the hourly wage distribution. The larger the ratio, the greater the gap between the 83 | top and the middle or the middle and the bottom of the wage distribution.

84 | 85 | 86 |
get_wage_ratios(by = NULL)
87 | 88 |

Arguments

89 |
90 |
by
91 |
NULL or character string with any combination of g (Gender) or 92 | r (Race), i.e. if you want to retrieve 93 | unemployment data by gender and race, you would set this parameter to "gr".
94 |
95 | 96 |

Value

97 | 98 |

tbl_df with data filtered by the selected criteria.

99 | 100 |

Details

101 | 102 |

    103 |
  • A 50–10 wage ratio of 1.91 means that workers at the 50th percentile of the wage 104 | distribution are paid 1.91 times more per hour than the workers at the 10th percentile. 105 |
  • 106 |
  • A 95–50 wage ratio of 3.28 means that workers at the 95th percentile of the wage 107 | distribution are paid 3.28 times more per hour than the workers at the 50th percentile. 108 |
  • 109 |

110 | 111 |

References

112 | 113 |

http://www.epi.org/data/

114 | 115 | 116 |

Examples

117 |
## Not run: ------------------------------------ 118 | # get_wage_ratios() 119 | # 120 | # get_wage_ratios("r") 121 | # 122 | # get_wage_ratios("gr") 123 | ## ---------------------------------------------
124 |
125 | 140 |
141 | 142 |
143 | 146 | 147 |
148 |

Site built with pkgdown.

149 |
150 | 151 |
152 |
153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/reference/get_wages_by_education.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive the average hourly wages of workers disaggregated by the highest level of education attained — get_wages_by_education • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Wages by education are the average hourly wages of workers disaggregated by the highest 82 | level of education attained. Employment shares provide the distribution of educational 83 | attainment for workers of each gender, racial, and ethnic group as a share of total 84 | employed for each group.

85 | 86 | 87 |
get_wages_by_education(by = NULL)
88 | 89 |

Arguments

90 |
91 |
by
92 |
NULL or character string with any combination of g (Gender) or 93 | r (Race), i.e. if you want to retrieve 94 | unemployment data by gender and race, you would set this parameter to "gr".
95 |
96 | 97 |

Value

98 | 99 |

tbl_df with data filtered by the selected criteria.

100 | 101 |

References

102 | 103 |

http://www.epi.org/data/

104 | 105 | 106 |

Examples

107 |
## Not run: ------------------------------------ 108 | # get_wages_by_education() 109 | # 110 | # get_wages_by_education("r") 111 | # 112 | # get_wages_by_education("gr") 113 | ## ---------------------------------------------
114 |
115 | 128 |
129 | 130 |
131 | 134 | 135 |
136 |

Site built with pkgdown.

137 |
138 | 139 |
140 |
141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /docs/reference/get_wages_by_percentile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Retreive wages at ten distinct points in the wage distribution — get_wages_by_percentile • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 79 | 80 | 81 |

Wage percentiles are wages at ten distinct points in the wage distribution: deciles 82 | and the 95th percentile. The 95–50 and 50–10 wage ratios show how much greater wages 83 | are at the top than the middle, and at the middle than the bottom, respectively.

84 | 85 | 86 |
get_wages_by_percentile(by = NULL)
87 | 88 |

Arguments

89 |
90 |
by
91 |
NULL or character string with any combination of g (Gender) or 92 | r (Race), i.e. if you want to retrieve 93 | unemployment data by gender and race, you would set this parameter to "gr".
94 |
95 | 96 |

Value

97 | 98 |

tbl_df with data filtered by the selected criteria.

99 | 100 |

References

101 | 102 |

http://www.epi.org/data/

103 | 104 | 105 |

Examples

106 |
## Not run: ------------------------------------ 107 | # get_wages_by_percentile() 108 | # 109 | # get_wages_by_percentile("r") 110 | # 111 | # get_wages_by_percentile("gr") 112 | ## ---------------------------------------------
113 |
114 | 127 |
128 | 129 |
130 | 133 | 134 |
135 |

Site built with pkgdown.

136 |
137 | 138 |
139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Function reference • epidata 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 |
38 |
39 | 70 | 71 | 72 |
73 | 74 |
75 |
76 | 80 | 81 |
82 |

All functions

83 |

84 | 85 | 86 |

A package to Tools to Retrieve Economic Policy Institute Data Library Extracts

87 | 90 | 91 |

Retreive the percent by which hourly wages of black workers are less than hourly wages of white workers

92 | 95 | 96 |

Retreive the percent by which hourly wages of college graduates exceed those of otherwise 97 |

98 | 101 | 102 |

Retreive the share of the civilian noninstitutional population that is employed

103 | 106 | 107 |

Retreive the percent by which hourly wages of female workers are less than hourly wages of male workers

108 | 111 | 112 |

Retreive the percent by which hourly wages of Hispanic workers are less than hourly wages of white workers

113 | 116 | 117 |

Retreive the share of the civilian noninstitutional population that is in the labor force

118 | 121 | 122 |

Retreive the share of the labor force that has been unemployed for six months or longer

123 | 126 | 127 |

Retreive the hourly wage in the middle of the wage distribution

128 | 131 | 132 |

Retreive the percent by which hourly wages of workers without a high school diploma 133 |

134 | 137 | 138 |

Retreive the share of the labor force that is "underemployed"

139 | 142 | 143 |

Retreive the share of the labor force without a job (by state)

144 | 147 | 148 |

Retreive the share of the labor force without a job

149 | 152 | 153 |

Retreive the level of inequality within the hourly wage distribution.

154 | 157 | 158 |

Retreive the average hourly wages of workers disaggregated by the highest level of education attained

159 | 162 | 163 |

Retreive wages at ten distinct points in the wage distribution

164 | 167 | 168 |
169 |
170 | 171 | 177 |
178 | 179 | 189 |
190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /epidata.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | StripTrailingWhitespace: Yes 16 | 17 | BuildType: Package 18 | PackageUseDevtools: Yes 19 | PackageInstallArgs: --no-multiarch --with-keep.source 20 | PackageBuildArgs: --resave-data 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /inst/tinytest/test_epidata.R: -------------------------------------------------------------------------------- 1 | library(epidata) 2 | 3 | if (at_home()) { 4 | suppressMessages(expect_true(inherits(get_annual_wages_and_work_hours(), "data.frame"))) 5 | # expect_true(inherits(get_annual_wages_by_wage_group(), "data.frame")) 6 | # expect_true(inherits(get_black_white_wage_gap(), "data.frame")) 7 | # expect_true(inherits(get_college_wage_premium(), "data.frame")) 8 | # expect_true(inherits(get_compensation_wages_and_benefits(), "data.frame")) 9 | # expect_true(inherits(get_employment_to_population_ratio(), "data.frame")) 10 | # expect_true(inherits(get_gender_wage_gap(), "data.frame")) 11 | # expect_true(inherits(get_health_insurance_coverage(), "data.frame")) 12 | # expect_true(inherits(get_hispanic_white_wage_gap(), "data.frame")) 13 | # expect_true(inherits(get_labor_force_participation_rate(), "data.frame")) 14 | # expect_true(inherits(get_long_term_unemployment(), "data.frame")) 15 | # expect_true(inherits(get_median_and_mean_wages(), "data.frame")) 16 | # expect_true(inherits(get_minimum_wage(), "data.frame")) 17 | # expect_true(inherits(get_non_high_school_wage_penalty(), "data.frame")) 18 | # expect_true(inherits(get_pension_coverage(), "data.frame")) 19 | # expect_true(inherits(get_poverty_level_wages(), "data.frame")) 20 | # expect_true(inherits(get_productivity_and_hourly_compensation(), "data.frame")) 21 | # expect_true(inherits(get_underemployment(), "data.frame")) 22 | # expect_true(inherits(get_unemployment(), "data.frame")) 23 | # expect_true(inherits(get_unemployment_by_state(), "data.frame")) 24 | # expect_true(inherits(get_union_coverage(), "data.frame")) 25 | # expect_true(inherits(get_wages_by_education(), "data.frame")) 26 | # expect_true(inherits(get_wages_by_percentile(), "data.frame")) 27 | # expect_true(inherits(get_wage_decomposition(), "data.frame")) 28 | # expect_true(inherits(get_wage_ratios(), "data.frame")) 29 | } else { 30 | expect_false(not_dos()) 31 | } -------------------------------------------------------------------------------- /man/epidata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/epidata-package.R 3 | \docType{package} 4 | \name{epidata} 5 | \alias{epidata} 6 | \title{A package to Tools to Retrieve Economic Policy Institute Data Library Extracts} 7 | \description{ 8 | The Economic Policy Institute provides researchers, media, and the public with easily 9 | accessible, up-to-date, and comprehensive historical data on the American labor force. 10 | It is compiled from Economic Policy Institute analysis of government data sources. Use 11 | it to research wages, inequality, and other economic indicators over time and among 12 | demographic groups. Data is usually updated monthly. 13 | } 14 | \author{ 15 | Bob Rudis (bob@rud.is) 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/epidata/dc17d09a82427dfd2aadefdc7701fe872c6b320a/man/figures/README-unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrbrmstr/epidata/dc17d09a82427dfd2aadefdc7701fe872c6b320a/man/figures/README-unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /man/get_annual_wages_and_work_hours.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wages_and_hours.r 3 | \name{get_annual_wages_and_work_hours} 4 | \alias{get_annual_wages_and_work_hours} 5 | \title{Retreive CPS ASEC Annual Wages and Work Hours} 6 | \usage{ 7 | get_annual_wages_and_work_hours() 8 | } 9 | \value{ 10 | \code{tbl_df} 11 | 12 | data frame 13 | } 14 | \description{ 15 | Annual, weekly, and hourly wages and work hours show the average wages and work hours 16 | of wage and salary workers using data from the CPS ASEC (also known as the March CPS). 17 | Note that this data is not directly comparable to the CPS ORG data in median/average 18 | hourly wage. 19 | } 20 | \note{ 21 | CPS ASEC | Murphy and Welch (1989) 22 | } 23 | \examples{ 24 | get_annual_wages_and_work_hours() 25 | } 26 | \references{ 27 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 28 | } 29 | -------------------------------------------------------------------------------- /man/get_annual_wages_by_wage_group.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annual-wages-by-wage-group.R 3 | \name{get_annual_wages_by_wage_group} 4 | \alias{get_annual_wages_by_wage_group} 5 | \title{Annual wages by wage group} 6 | \usage{ 7 | get_annual_wages_by_wage_group() 8 | } 9 | \value{ 10 | \code{tbl_df} with data filtered by the selected criteria. 11 | 12 | data frame 13 | } 14 | \description{ 15 | Return the average annual salaries for select wage groups, with particular focus on 16 | the highest wage earners. Note that this data is not directly comparable to wage 17 | deciles/percentiles. 18 | } 19 | \details{ 20 | Wages are in 2017 dollars. Population sample: All workers. 21 | 22 | The average annual wages by wage group are taken from a 2010 article by Wojciech Kopczuk, 23 | Emmanuel Saez, and Jae Song. To extend this series, data for 2006 through 2017 are 24 | extrapolated from 2004 data using changes in wage shares computed from Social Security 25 | Administration wage statistics. We employ the midpoint of the bracket to compute total 26 | wage income in each bracket and sum all brackets. We then use interpolation to derive 27 | percentile cutoffs building from the bottom up to obtain the 0–90th percentile bracket 28 | and then estimate the remaining categories. This allows us to estimate the wage shares 29 | for upper wage groups. We use these wage shares computed for 2004 and later years to 30 | extend the Kopczuk, Saez, and Song series by adding the changes in share between 2004 31 | and the relevant year to their series. To obtain absolute wage trends we use the SSA data 32 | on the total wage pool and employment and compute the real wage per worker (based on t 33 | heir share of wages and employment) in the different groups in 2017 dollars. For a 34 | detailed explanation, see the methodology for annual wages and hours. 35 | } 36 | \note{ 37 | Data source: SSA | Kopczuk, Saez, and Song (2010) 38 | } 39 | \examples{ 40 | if (not_dos()) get_annual_wages_by_wage_group() 41 | } 42 | \references{ 43 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 44 | } 45 | -------------------------------------------------------------------------------- /man/get_black_white_wage_gap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_black_white_wage_gap} 4 | \alias{get_black_white_wage_gap} 5 | \title{Retreive the percent by which hourly wages of black workers are less than hourly wages of white workers} 6 | \usage{ 7 | get_black_white_wage_gap(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or \code{g} for a parition by gender} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | } 15 | \description{ 16 | The black-white wage gap is the percent by which hourly wages of black workers are less 17 | than hourly wages of white workers. It is also often expressed as a wage ratio (black 18 | workers' share of white workers' wages) by subtracting the gap from 100 percent. 19 | } 20 | \details{ 21 | \itemize{ 22 | \item{A median black-white wage gap of 26.2 percent means that a typical black worker 23 | is paid 26.2 percent less per hour than a typical white worker.} 24 | \item{An average black-white wage gap of 26.6 percent means that on average black 25 | workers are paid 26.6 percent less per hour than white workers.} 26 | \item{A regression-based black-white wage gap of 15.2 percent means that on average 27 | black workers are paid 15.2 percent less per hour than white workers, all else 28 | held equal (controlling for gender, race and ethnicity, education, experience, 29 | and geographic location).} 30 | } 31 | } 32 | \examples{ 33 | get_black_white_wage_gap() 34 | 35 | get_black_white_wage_gap("g") 36 | } 37 | \references{ 38 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 39 | } 40 | -------------------------------------------------------------------------------- /man/get_college_wage_premium.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_college_wage_premium} 4 | \alias{get_college_wage_premium} 5 | \title{Retreive the percent by which hourly wages of college graduates exceed those of otherwise 6 | equivalent high school graduates} 7 | \usage{ 8 | get_college_wage_premium(by = NULL) 9 | } 10 | \arguments{ 11 | \item{by}{\code{NULL} or \code{g} for a parition by gender} 12 | } 13 | \value{ 14 | \code{tbl_df} with data filtered by the selected criteria. 15 | } 16 | \description{ 17 | A regression-based college wage premium of 56.1 percent means that on average workers 18 | with a college degree are paid 56.1 percent more per hour than workers whose highest 19 | education credential is a high school diploma, all else held equal (controlling for 20 | gender, race and ethnicity, education, experience, and geographic location). 21 | } 22 | \examples{ 23 | get_college_wage_premium() 24 | 25 | get_college_wage_premium("g") 26 | } 27 | \references{ 28 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 29 | } 30 | -------------------------------------------------------------------------------- /man/get_compensation_wages_and_benefits.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compensation-wages-benefits.R 3 | \name{get_compensation_wages_and_benefits} 4 | \alias{get_compensation_wages_and_benefits} 5 | \title{Compensation, wages, and benefits} 6 | \usage{ 7 | get_compensation_wages_and_benefits() 8 | } 9 | \value{ 10 | \code{tbl_df} with data filtered by the selected criteria. 11 | 12 | data frame 13 | } 14 | \description{ 15 | Return the nonwage payments, referred to as fringe benefits, and wages. 16 | Compensation includes employer payments for health insurance, pensions, 17 | and payroll taxes (primarily payments toward Social Security and unemployment insurance). 18 | } 19 | \details{ 20 | Wages are in 2016 dollars. Wage and salary workers (NIPA) | Private-sector workers (ECEC) 21 | } 22 | \note{ 23 | Data source: NIPA | ECEC 24 | } 25 | \examples{ 26 | if (not_dos()) get_compensation_wages_and_benefits() 27 | } 28 | \references{ 29 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 30 | } 31 | -------------------------------------------------------------------------------- /man/get_employment_to_population_ratio.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_employment_to_population_ratio} 4 | \alias{get_employment_to_population_ratio} 5 | \title{Retreive the share of the civilian noninstitutional population that is employed} 6 | \usage{ 7 | get_employment_to_population_ratio(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 12 | unemployment data by gender, race and education, you would set this parameter to "\code{gre}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | 17 | data frame 18 | } 19 | \description{ 20 | Retreive the share of the civilian noninstitutional population that is employed 21 | } 22 | \examples{ 23 | if (not_dos()) get_employment_to_population_ratio() 24 | 25 | if (not_dos()) get_employment_to_population_ratio("r") 26 | 27 | if (not_dos()) get_employment_to_population_ratio("grae") 28 | } 29 | \references{ 30 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 31 | } 32 | -------------------------------------------------------------------------------- /man/get_gender_wage_gap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_gender_wage_gap} 4 | \alias{get_gender_wage_gap} 5 | \title{Retreive the percent by which hourly wages of female workers are less than hourly wages of male workers} 6 | \usage{ 7 | get_gender_wage_gap(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or \code{r} for a parition by race} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | } 15 | \description{ 16 | The gender wage gap is the percent by which hourly wages of female workers are less than 17 | hourly wages of male workers. It is also often expressed as a wage ratio (women's 18 | share of men's wages) by subtracting the gap from 100 percent. 19 | } 20 | \details{ 21 | \itemize{ 22 | \item{A median gender wage gap of 17.3 percent means that a typical woman is paid 17.3 23 | percent less per hour than a typical man.} 24 | \item{An average gender wage gap of 19.7 percent means that on average women are paid 25 | 19.7 percent less per hour than men.} 26 | \item{A regression-based gender wage gap of 21.7 percent means that on average women 27 | are paid 21.7 percent less per hour than men, all else held equal (controlling for 28 | gender, race and ethnicity, education, experience, and geographic location).} 29 | } 30 | } 31 | \examples{ 32 | get_gender_wage_gap() 33 | 34 | get_gender_wage_gap("r") 35 | } 36 | \references{ 37 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 38 | } 39 | -------------------------------------------------------------------------------- /man/get_health_insurance_coverage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/health.r 3 | \name{get_health_insurance_coverage} 4 | \alias{get_health_insurance_coverage} 5 | \title{Retreive Health Insurance Coverage} 6 | \usage{ 7 | get_health_insurance_coverage(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 12 | i.e. if you want to retrieve unemployment data by gender and race, you would set this 13 | parameter to "\code{gr}".} 14 | } 15 | \value{ 16 | \code{tbl_df} with data filtered by the selected criteria. 17 | 18 | data frame 19 | } 20 | \description{ 21 | Employer-sponsored health insurance (ESI) coverage shows the share of workers who 22 | received health insurance from their own job for which their employer paid for at 23 | least some of their health insurance coverage. 24 | } 25 | \details{ 26 | Population sample: Private-sector workers age 18–64 & at least 20 hours/week and 26 weeks/year 27 | } 28 | \note{ 29 | Data source: CPS ASEC 30 | } 31 | \examples{ 32 | if (not_dos()) get_health_insurance_coverage() 33 | 34 | if (not_dos()) get_health_insurance_coverage("r") 35 | 36 | if (not_dos()) get_health_insurance_coverage("gr") 37 | } 38 | \references{ 39 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 40 | } 41 | -------------------------------------------------------------------------------- /man/get_hispanic_white_wage_gap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_hispanic_white_wage_gap} 4 | \alias{get_hispanic_white_wage_gap} 5 | \title{Retreive the percent by which hourly wages of Hispanic workers are less than hourly wages of white workers} 6 | \usage{ 7 | get_hispanic_white_wage_gap(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or \code{g} for a parition by gender} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | } 15 | \description{ 16 | The Hispanic-white wage gap is the percent by which hourly wages of Hispanic workers 17 | are less than hourly wages of white workers. It is also often expressed as a wage ratio 18 | (Hispanic workers' share of white workers' wages) by subtracting the gap from 100 percent. 19 | } 20 | \details{ 21 | \itemize{ 22 | \item{A median Hispanic-white wage gap of 29.6 percent means that a typical Hispanic 23 | worker is paid 29.6 percent less per hour than a typical white worker.} 24 | \item{An average Hispanic-white wage gap of 30.1 percent means that on average Hispanic 25 | workers are paid 30.1 percent less per hour than white workers.} 26 | \item{A regression-based Hispanic-white wage gap of 11.1 percent means that on average 27 | Hispanic workers are paid 11.1 percent less per hour than white workers, all 28 | else held equal (controlling for gender, race and ethnicity, education, 29 | experience, and geographic location).} 30 | } 31 | } 32 | \examples{ 33 | get_hispanic_white_wage_gap() 34 | 35 | get_hispanic_white_wage_gap("g") 36 | } 37 | \references{ 38 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 39 | } 40 | -------------------------------------------------------------------------------- /man/get_labor_force_participation_rate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_labor_force_participation_rate} 4 | \alias{get_labor_force_participation_rate} 5 | \title{Retreive the share of the civilian noninstitutional population that is in the labor force} 6 | \usage{ 7 | get_labor_force_participation_rate(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 12 | unemployment data by gender, race and education, you would set this parameter to "\code{gre}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | (i.e., working or looking for work) 19 | } 20 | \examples{ 21 | get_labor_force_participation_rate() 22 | 23 | get_labor_force_participation_rate("r") 24 | 25 | get_labor_force_participation_rate("grae") 26 | } 27 | \references{ 28 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 29 | } 30 | -------------------------------------------------------------------------------- /man/get_long_term_unemployment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_long_term_unemployment} 4 | \alias{get_long_term_unemployment} 5 | \title{Retreive the share of the labor force that has been unemployed for six months or longer} 6 | \usage{ 7 | get_long_term_unemployment(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 12 | unemployment data by gender, race and education, you would set this parameter to "\code{gre}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | Retreive the share of the labor force that has been unemployed for six months or longer 19 | } 20 | \examples{ 21 | get_long_term_unemployment() 22 | 23 | get_long_term_unemployment("r") 24 | 25 | get_long_term_unemployment("grae") 26 | } 27 | \references{ 28 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 29 | } 30 | -------------------------------------------------------------------------------- /man/get_median_and_mean_wages.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wages.r 3 | \name{get_median_and_mean_wages} 4 | \alias{get_median_and_mean_wages} 5 | \title{Retreive the hourly wage in the middle of the wage distribution} 6 | \usage{ 7 | get_median_and_mean_wages(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 12 | i.e. if you want to wage data by gender and race, you would set this 13 | parameter to "\code{gr}".} 14 | } 15 | \value{ 16 | \code{tbl_df} with data filtered by the selected criteria. 17 | } 18 | \description{ 19 | The median wage is the hourly wage in the middle of the wage distribution; 20 | 50 percent of wage earners earn less and 50 percent earn more. The average wage is 21 | the arithmetic mean of hourly wages; or, the sum of all workers' hourly wages divided 22 | by the number of workers. 23 | } 24 | \examples{ 25 | get_median_and_mean_wages() 26 | 27 | get_median_and_mean_wages("r") 28 | 29 | get_median_and_mean_wages("gr") 30 | } 31 | \references{ 32 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 33 | } 34 | -------------------------------------------------------------------------------- /man/get_minimum_wage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/minimum-wage.R 3 | \name{get_minimum_wage} 4 | \alias{get_minimum_wage} 5 | \title{Minimum wage} 6 | \usage{ 7 | get_minimum_wage() 8 | } 9 | \value{ 10 | \code{tbl_df} with data filtered by the selected criteria. 11 | 12 | data frame 13 | } 14 | \description{ 15 | Return tthe hourly minimum wage set by federal law. The real minimum wage is the federal 16 | hourly minimum wage adjusted for inflation. 17 | } 18 | \details{ 19 | Wages are in 2016 dollars, excluding the nominal federal minimum wage. Share of average 20 | wages based on the average wages of production and nonsupervisory workers. For state 21 | minimum wages, see EPI’s minimum wage tracker. 22 | 23 | Population sample: Production and nonsupervisory workers (average wages) 24 | } 25 | \note{ 26 | Data source: U.S. Department of Labor Wage and Hour Division | CES 27 | } 28 | \examples{ 29 | if (not_dos()) get_minimum_wage() 30 | } 31 | \references{ 32 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 33 | } 34 | -------------------------------------------------------------------------------- /man/get_non_high_school_wage_penalty.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_non_high_school_wage_penalty} 4 | \alias{get_non_high_school_wage_penalty} 5 | \title{Retreive the percent by which hourly wages of workers without a high school diploma 6 | (or equivalent) are less than wages of otherwise equivalent workers who have graduated 7 | from high school} 8 | \usage{ 9 | get_non_high_school_wage_penalty(by = NULL) 10 | } 11 | \arguments{ 12 | \item{by}{\code{NULL} or \code{g} for a parition by gender} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | A regression-based non-high school wage penalty of 21.8 percent means that on average 19 | workers without a high school diploma are paid 21.8 percent less per hour than workers 20 | with a high school diploma, all else held equal (controlling for gender, race and 21 | ethnicity, education, experience, and geographic location). 22 | } 23 | \examples{ 24 | \dontrun{ 25 | get_non_high_school_wage_penalty() 26 | 27 | get_non_high_school_wage_penalty("g") 28 | } 29 | } 30 | \references{ 31 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 32 | } 33 | -------------------------------------------------------------------------------- /man/get_pension_coverage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pension.r 3 | \name{get_pension_coverage} 4 | \alias{get_pension_coverage} 5 | \title{Retreive Pension Coverage} 6 | \usage{ 7 | get_pension_coverage(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{e} (Education), \code{d} (Percentile), \code{l} (Entry-level) 12 | i.e. if you want to retrieve pension data by gender and race, you would set this 13 | parameter to "\code{gr}".} 14 | } 15 | \value{ 16 | \code{tbl_df} with data filtered by the selected criteria. 17 | 18 | data frame 19 | } 20 | \description{ 21 | Employer-provided pension coverage shows the share of workers included in an 22 | employer-provided plan for which the employer paid for at least some of their pension 23 | coverage. 24 | } 25 | \details{ 26 | Population sample: Private-sector workers age 18–64 & at least 20 hours/week and 26 weeks/year 27 | } 28 | \note{ 29 | Data source: CPS ASEC 30 | } 31 | \examples{ 32 | if (not_dos()) get_health_insurance_coverage() 33 | 34 | if (not_dos()) get_health_insurance_coverage("r") 35 | 36 | if (not_dos()) get_health_insurance_coverage("gr") 37 | } 38 | \references{ 39 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 40 | } 41 | -------------------------------------------------------------------------------- /man/get_poverty_level_wages.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/poverty.R 3 | \name{get_poverty_level_wages} 4 | \alias{get_poverty_level_wages} 5 | \title{Poverty-level wages} 6 | \usage{ 7 | get_poverty_level_wages(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender) or 11 | \code{r} (Race), i.e. if you want to retrieve 12 | unemployment data by gender and race, you would set this parameter to "\code{gr}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | 17 | data frame 18 | } 19 | \description{ 20 | Return the share of workers earning equal to or less than the poverty-level wage, or 21 | the hourly wage that a full-time, year-round worker must earn to sustain a family of 22 | four with two children at the official poverty threshold. 23 | } 24 | \details{ 25 | Population sample: Wage and salary workers age 18–64. Data source: CPS ORG | Census 26 | Bureau (poverty threshold) 27 | } 28 | \examples{ 29 | if (not_dos()) get_poverty_level_wages() 30 | 31 | if (not_dos()) get_poverty_level_wages("r") 32 | 33 | if (not_dos()) get_poverty_level_wages("gr") 34 | } 35 | \references{ 36 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 37 | } 38 | -------------------------------------------------------------------------------- /man/get_productivity_and_hourly_compensation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/productivity.r 3 | \name{get_productivity_and_hourly_compensation} 4 | \alias{get_productivity_and_hourly_compensation} 5 | \title{Retreive Productivity and hourly compensation} 6 | \usage{ 7 | get_productivity_and_hourly_compensation(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string of \code{g} (Gender)} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | 15 | data frame 16 | } 17 | \description{ 18 | Productivity is how much workers produce per hour, or the growth of output of goods and 19 | services minus depreciation per hour worked. Compensation is made up of both nonwage 20 | payments and wages. 21 | } 22 | \details{ 23 | Wages are in 2015 dollars. Median compensation is calculated using hourly wage medians 24 | from the CPS ORG and compensation from NIPA. 25 | 26 | Population sample: All workers & Production and nonsupervisory workers 27 | } 28 | \note{ 29 | Data source: NIPA (compensation) | BLS Productivity Data 30 | } 31 | \examples{ 32 | if (not_dos()) get_productivity_and_hourly_compensation() 33 | 34 | if (not_dos()) get_productivity_and_hourly_compensation("g") 35 | } 36 | \references{ 37 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 38 | } 39 | -------------------------------------------------------------------------------- /man/get_underemployment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_underemployment} 4 | \alias{get_underemployment} 5 | \title{Retreive the share of the labor force that is "underemployed"} 6 | \usage{ 7 | get_underemployment(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 12 | unemployment data by gender, race and education, you would set this parameter to "\code{gre}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | Underemployment is the share of the labor force that either 1) is unemployed, 2) is 19 | working part time but wants and is available to work full time (an "involuntary" part 20 | timer), or 3) wants and is available to work and has looked for work in the last year 21 | but has given up actively seeking work in the last four weeks ("marginally attached" 22 | worker). 23 | } 24 | \examples{ 25 | get_underemployment() 26 | 27 | get_underemployment("r") 28 | 29 | get_underemployment("grae") 30 | } 31 | \references{ 32 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 33 | } 34 | -------------------------------------------------------------------------------- /man/get_unemployment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_unemployment} 4 | \alias{get_unemployment} 5 | \title{Retreive the share of the labor force without a job} 6 | \usage{ 7 | get_unemployment(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender), 11 | \code{r} (Race), \code{a} (Age), \code{e} (Education). i.e. if you want to retrieve 12 | unemployment data by gender, race and education, you would set this parameter to "\code{gre}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | Retreive the share of the labor force without a job 19 | } 20 | \note{ 21 | See \code{get_unemployment_by_state()} for information on retrieving unemployment by state+race. 22 | } 23 | \examples{ 24 | get_unemployment() 25 | 26 | get_unemployment("r") 27 | 28 | get_unemployment("grae") 29 | } 30 | \references{ 31 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 32 | } 33 | -------------------------------------------------------------------------------- /man/get_unemployment_by_state.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/employment.r 3 | \name{get_unemployment_by_state} 4 | \alias{get_unemployment_by_state} 5 | \title{Retreive the share of the labor force without a job (by state)} 6 | \usage{ 7 | get_unemployment_by_state(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or \code{r} for a partition by race.} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | } 15 | \description{ 16 | Retreive the share of the labor force without a job (by state) 17 | } 18 | \note{ 19 | See \code{get_unemployment()} for other unemployment extracts.. 20 | } 21 | \examples{ 22 | get_unemployment_by_state() 23 | 24 | get_unemployment_by_state("r") 25 | } 26 | \references{ 27 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 28 | } 29 | -------------------------------------------------------------------------------- /man/get_union_coverage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/union.r 3 | \name{get_union_coverage} 4 | \alias{get_union_coverage} 5 | \title{Retreive Union Coverage} 6 | \usage{ 7 | get_union_coverage() 8 | } 9 | \value{ 10 | \code{tbl_df} 11 | 12 | data frame 13 | } 14 | \description{ 15 | The union coverage rate shows the percentage of the workforce covered by a collective 16 | bargaining agreement. 17 | } 18 | \note{ 19 | Data source: CPS ORG | Hirsch and Macpherson (2003) 20 | } 21 | \examples{ 22 | if (interactive()) get_union_coverage() 23 | } 24 | \references{ 25 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 26 | } 27 | -------------------------------------------------------------------------------- /man/get_wage_decomposition.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wage_decomposition.r 3 | \name{get_wage_decomposition} 4 | \alias{get_wage_decomposition} 5 | \title{Retreive Wage Decomposition} 6 | \usage{ 7 | get_wage_decomposition(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string of \code{g} (Gender)} 11 | } 12 | \value{ 13 | \code{tbl_df} with data filtered by the selected criteria. 14 | 15 | data frame 16 | } 17 | \description{ 18 | Wage inequality data shows the overall wage inequality and the within-group and 19 | between-group wage inequality over time. These measures allow an examination of how 20 | much of the change in overall wage inequality in particular periods was due to changes 21 | in within-group and between-group wage inequality. 22 | } 23 | \details{ 24 | Population sample: Wage and salary workers age 18–64 25 | } 26 | \note{ 27 | Data source: CPS ORG 28 | } 29 | \examples{ 30 | get_wages_by_percentile() 31 | 32 | get_wages_by_percentile("g") 33 | } 34 | \references{ 35 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 36 | } 37 | -------------------------------------------------------------------------------- /man/get_wage_ratios.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gaps.r 3 | \name{get_wage_ratios} 4 | \alias{get_wage_ratios} 5 | \title{Retreive the level of inequality within the hourly wage distribution.} 6 | \usage{ 7 | get_wage_ratios(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender) or 11 | \code{r} (Race), i.e. if you want to retrieve 12 | unemployment data by gender and race, you would set this parameter to "\code{gr}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | 17 | data frame 18 | } 19 | \description{ 20 | The 95–50 and 50–10 wage ratios are representations of the level of inequality within 21 | the hourly wage distribution. The larger the ratio, the greater the gap between the 22 | top and the middle or the middle and the bottom of the wage distribution. 23 | } 24 | \details{ 25 | \itemize{ 26 | \item{A 50–10 wage ratio of 1.91 means that workers at the 50th percentile of the wage 27 | distribution are paid 1.91 times more per hour than the workers at the 10th percentile.} 28 | \item{A 95–50 wage ratio of 3.28 means that workers at the 95th percentile of the wage 29 | distribution are paid 3.28 times more per hour than the workers at the 50th percentile.} 30 | } 31 | } 32 | \examples{ 33 | if (not_dos()) get_wage_ratios() 34 | 35 | if (not_dos()) get_wage_ratios("r") 36 | 37 | if (not_dos()) get_wage_ratios("gr") 38 | } 39 | \references{ 40 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 41 | } 42 | -------------------------------------------------------------------------------- /man/get_wages_by_education.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wages.r 3 | \name{get_wages_by_education} 4 | \alias{get_wages_by_education} 5 | \title{Retreive the average hourly wages of workers disaggregated by the highest level of education attained} 6 | \usage{ 7 | get_wages_by_education(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender) or 11 | \code{r} (Race), i.e. if you want to retrieve 12 | unemployment data by gender and race, you would set this parameter to "\code{gr}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | } 17 | \description{ 18 | Wages by education are the average hourly wages of workers disaggregated by the highest 19 | level of education attained. Employment shares provide the distribution of educational 20 | attainment for workers of each gender, racial, and ethnic group as a share of total 21 | employed for each group. 22 | } 23 | \examples{ 24 | get_wages_by_education() 25 | 26 | get_wages_by_education("r") 27 | 28 | get_wages_by_education("gr") 29 | } 30 | \references{ 31 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 32 | } 33 | -------------------------------------------------------------------------------- /man/get_wages_by_percentile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wages.r 3 | \name{get_wages_by_percentile} 4 | \alias{get_wages_by_percentile} 5 | \title{Retreive wages at ten distinct points in the wage distribution} 6 | \usage{ 7 | get_wages_by_percentile(by = NULL) 8 | } 9 | \arguments{ 10 | \item{by}{\code{NULL} or character string with any combination of \code{g} (Gender) or 11 | \code{r} (Race), i.e. if you want to retrieve 12 | unemployment data by gender and race, you would set this parameter to "\code{gr}".} 13 | } 14 | \value{ 15 | \code{tbl_df} with data filtered by the selected criteria. 16 | 17 | data frame 18 | } 19 | \description{ 20 | Wage percentiles are wages at ten distinct points in the wage distribution: deciles 21 | and the 95th percentile. The 95–50 and 50–10 wage ratios show how much greater wages 22 | are at the top than the middle, and at the middle than the bottom, respectively. 23 | } 24 | \examples{ 25 | get_wages_by_percentile() 26 | 27 | get_wages_by_percentile("r") 28 | 29 | get_wages_by_percentile("gr") 30 | } 31 | \references{ 32 | \href{https://www.epi.org/data/}{Economic Policy Institute Data Library} 33 | } 34 | -------------------------------------------------------------------------------- /man/not_dos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/aaa.r 3 | \name{not_dos} 4 | \alias{not_dos} 5 | \title{Not DoS'ing EPI/Cloudflare} 6 | \usage{ 7 | not_dos() 8 | } 9 | \value{ 10 | logical 11 | } 12 | \description{ 13 | Not DoS'ing EPI/Cloudflare 14 | } 15 | -------------------------------------------------------------------------------- /tests/tinytest.R: -------------------------------------------------------------------------------- 1 | 2 | if ( requireNamespace("tinytest", quietly=TRUE) ){ 3 | tinytest::test_package("epidata") 4 | } 5 | 6 | --------------------------------------------------------------------------------