Exploratory data analysis

Motivation In my graduate program we had an excellent text on Regression Methods in Biostatistics (which I will refer to as VGSM). Unfortunately, all of the examples and code from the courses, labs, and text were in Stata. As an R user, I kept having to translate the topics from Stata into R. But this […]

Scraping wikipedia tables

I recently ran into an issue in which I needed to create a long regular expression to match medications (antibiotics, specifically) in a giant medications table from an electronic health record (EHR). I wasn’t given a list of antibiotics to look for, but I did know this would end up as a binary (yes/no) variable […]

Reproduce Tables and Figures (3/3)

Martin Frigaard 11/15/2017 This is the third of three posts for setting up a data project. The first post dealt with creating project folders and downloading files and data from the Internet. The second post went over a bit of data wrangling. In this post I will attempt to recreate come of the table counts […]

Reading and wrangling data (2/3)

Martin Frigaard 11/15/2017 In my last post I set up my project folders and downloaded the data sets for the article, “Contagion in Mass Killings and School Shootings”. Reading data into RStudio I am going to read the data into the RStudio environment. I recommend using read_csv for plain text files (this function is from […]