class: middle, center, inverse <style type="text/css"> .my-logo-right { content: ""; position: absolute; top: 15px; right: 40px; height: 200px; width: 120px; background-repeat: no-repeat; background-size: contain; background-image: url(logo_sds.png); } .my-logo-left { content: ""; position: absolute; top: 15px; left: 40px; height: 150px; width: 103px; background-repeat: no-repeat; background-size: contain; background-image: url(r_hex_fec16-2.png); } </style> <div class="my-logo-right"></div> <div class="my-logo-left"></div> # fec16 ## An R Package Containing Relational Data From The U.S. 2016 Elections ### Marium A. Tapal #### Co-authors: Benjamin S. Baumer, Irene Ryan, Rana Gahwagy ### [Statistical & Data Sciences, Smith College](http://www.smith.edu/sds) ### eUSR 2020 --- class: top ## What is `fec16`? - a data package for use in programming language R - contains cleaned relational data - from the 2015-2016 United States federal election cycle ## What data does it contain? - authoritative information about candidates, committees, contributions, expenditures, election results ## How is the data included? - most datasets are included in full - small samples of some datasets - retrieving the entire datasets is easy through built-in functions --- .pull-left[ # Main Objectives - Easy access to the data - Relational data suitable for teaching and learning - Data is pre-cleaned and wrangled ## Other Reasons - open source nature - real data in a genre not seen often - diversity of election data ] .pull-right[ > <font size="6"> Teach and Learn Statistics and Data Science using real data from the 2016 U.S. elections. All data is relational for easy joins!</font> ] --- # Datasets Included <table class="table" style="font-size: 16px; margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:left;"> Dataset Name </th> <th style="text-align:center;"> Full or Sample? </th> <th style="text-align:left;"> Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> candidates </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> candidates registered with the FEC during the 2016 election cycle </td> </tr> <tr> <td style="text-align:left;"> committees </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> committees registered with the FEC during the 2016 election cycle </td> </tr> <tr> <td style="text-align:left;"> campaigns </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> House/Senate current campaigns </td> </tr> <tr> <td style="text-align:left;"> results_house </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> House results of the 2016 general election </td> </tr> <tr> <td style="text-align:left;"> results_senate </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> Senate results of the 2016 general election </td> </tr> <tr> <td style="text-align:left;"> results_president </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> final results of the 2016 general election </td> </tr> <tr> <td style="text-align:left;"> pac </td> <td style="text-align:center;"> Full </td> <td style="text-align:left;"> Political Action Committee (PAC) and party summary financial information </td> </tr> <tr> <td style="text-align:left;"> individuals </td> <td style="text-align:center;"> Sample </td> <td style="text-align:left;"> individual contributions to candidates/committees during the 2016 election cycle </td> </tr> <tr> <td style="text-align:left;"> contributions </td> <td style="text-align:center;"> Sample </td> <td style="text-align:left;"> candidates and their contributions from committees during the 2016 election cycle </td> </tr> <tr> <td style="text-align:left;"> expenditures </td> <td style="text-align:center;"> Sample </td> <td style="text-align:left;"> operating expenditures </td> </tr> <tr> <td style="text-align:left;"> transactions </td> <td style="text-align:center;"> Sample </td> <td style="text-align:left;"> transactions between committees </td> </tr> </tbody> </table> --- # Functions Included <table class="table" style="font-size: 16px; margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:left;"> Dataset Name </th> <th style="text-align:left;"> Function Name </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> individuals </td> <td style="text-align:left;"> read_all_individuals() </td> </tr> <tr> <td style="text-align:left;"> contributions </td> <td style="text-align:left;"> read_all_contributions() </td> </tr> <tr> <td style="text-align:left;"> expenditures </td> <td style="text-align:left;"> read_all_expenditures() </td> </tr> <tr> <td style="text-align:left;"> transactions </td> <td style="text-align:left;"> read_all_transactions() </td> </tr> </tbody> </table> The functions are called `read_all_*()`, where \* is the name of the dataset --- # Install `fec16` ```r install.packages("fec16") ``` -- # Load `fec16` ```r library(fec16) ``` --- # Example ```r head(candidates) ``` ``` ## # A tibble: 6 x 15 ## cand_id cand_name cand_pty_affili… cand_election_yr cand_office_st cand_office ## <chr> <chr> <chr> <dbl> <chr> <chr> ## 1 H0AL02… ROBY, MA… REP 2016 AL H ## 2 H0AL02… JOHN, RO… IND 2016 AL H ## 3 H0AL05… BROOKS, … REP 2016 AL H ## 4 H0AL07… SEWELL, … DEM 2016 AL H ## 5 H0AR01… CRAWFORD… REP 2016 AR H ## 6 H0AR03… WOMACK, … REP 2016 AR H ## # … with 9 more variables: cand_office_district <chr>, cand_ici <chr>, ## # cand_status <chr>, cand_pcc <chr>, cand_st1 <chr>, cand_st2 <chr>, ## # cand_city <chr>, cand_st <chr>, cand_zip <chr> ``` -- ```r all_contributions <- read_all_contributions() ``` --- # Learn More The development version can be found on GitHub at [https://github.com/baumer-lab/fec16](https://github.com/baumer-lab/fec16) or scan the following QR code: <img src="github.png" width="37%" height="37%" style="display: block; margin: auto;" /> --- class: center, middle # Thank you!
[mtapal@smith.edu](mailto:mtapal@smith.edu) |
[mariumtapal](http://www.github.com/mariumtapal) |
[mariumtapal](http://www.twitter.com/mariumtapal)