It seems that much of the data analysis work I've done over the last few months has followed a "script". First, identify data, often government-sponsored and freely-available, that's of keen interest. Next, find the websites that house the data and download the relevant files to my notebook. The downloads might ultimately be one-off or included in the data analysis programs. Finally, load the data into either R or python and have at it with queries, visualizations, and statistical/learning models.

Several examples of recent work come to mind. The first involves data from the Bureau of Labor Statistics on jobs and educational attainment from 1992-2017. On this site, 24 spreadsheets are available detailing monthly statistics on six measures of employment by 4 levels of educational attainment. For a previous blog, I downloaded 12 of these files, including measurements laborforce, employed, and unemployed by educational levels no HS, HS grad, some college, and college grad. I renamed the spreadsheets on my SSD to include indicators of dimension -- eg "clf_laborforce_collegegrad.xls".

The second example, the topic of this blog, has to do with Medicare charges summarized by hospital and diagnostic related grou... At this point there are five files (either csv or spreadsheet) available for download, representing the years 2011-2015. Year is embedded in the website file names.

A third illustration, and the topic of a coming blog, revolves on census data from the American Community Survey.

The pattern behind the three cases includes:

- readily downloadable files, generally either csv or xls. These files can either be copied by hand or moved programmatically.
- multiple of these files, often dimensioned by time or other variable(s).
- a common, consistent format to the files, so that "reads" will work similarly on each.
- a structured file naming convention, either given or assigned, that provides dimensional info for data loads. Date/Time is the most common diemnsion.

In this article, I looked at the Medicare charges data that consists of five yearly csv files. I expect the next year in the sequence, 2016, to be posted in the near future. I first downloaded the five files to my laptop, programmatically in this case. I then used Jupyter Notebook and R 3.4 to analyze the data with code that takes advantage of the commonalities. The data.table package along with the tidyverse ecosystem and fast file compression, read/write library fst, plus a functional approach, are central to the work.

This is not your older sibling's R. None of the highly-performant packages used here are included in core R. Rather, they are the bounty of an exhuberant and capable R ecosystem of developers. Incidentally, if this notebook were written in python, I'd be giving similar accolades to its community.

The remainder of the notebook details the R code to implement the loading of this data into R and some simple subsequent analysis. The structure of the code in this instance is very similar to that of the other examples cited.

To read entire content, click here

© 2019 Data Science Central ® Powered by

Badges | Report an Issue | Privacy Policy | Terms of Service

**Most Popular Content on DSC**

To not miss this type of content in the future, subscribe to our newsletter.

- Book: Statistics -- New Foundations, Toolbox, and Machine Learning Recipes
- Book: Classification and Regression In a Weekend - With Python
- Book: Applied Stochastic Processes
- Long-range Correlations in Time Series: Modeling, Testing, Case Study
- How to Automatically Determine the Number of Clusters in your Data
- New Machine Learning Cheat Sheet | Old one
- Confidence Intervals Without Pain - With Resampling
- Advanced Machine Learning with Basic Excel
- New Perspectives on Statistical Distributions and Deep Learning
- Fascinating New Results in the Theory of Randomness
- Fast Combinatorial Feature Selection

**Other popular resources**

- Comprehensive Repository of Data Science and ML Resources
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- 100 Data Science Interview Questions and Answers
- Cheat Sheets | Curated Articles | Search | Jobs | Courses
- Post a Blog | Forum Questions | Books | Salaries | News

**Archives:** 2008-2014 |
2015-2016 |
2017-2019 |
Book 1 |
Book 2 |
More

**Most popular articles**

- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Time series, Growth Modeling and Data Science Wizardy
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- How to Automatically Determine the Number of Clusters in your Data
- Fascinating New Results in the Theory of Randomness
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions

## You need to be a member of Data Science Central to add comments!

Join Data Science Central