Visualizing statistical distributions with javascript
For the past few years, I’ve been developing and using a library I created that allows me to easily generate visualizations of statistical distributions for teaching. One can specify a distribution along with a parametrization, and the library sees it and generates a table containing all the distributions, which gives links to interactive plots that allow anyone to see how changing the parameters affects the distribution. In addition, clicking on the plot allows finding areas under the distribution. Users can switch between PDF and CDF views. I’ve now opened the code on github.

How to get your very own RStudio Server and Shiny Server with DigitalOcean
If you’ve always wanted to have an RStudio Server of your own so that you can access R from anywhere, or your own Shiny Server to host your awesome shiny apps, DigitalOcean (DO) can help you get there easily. DigitalOcean provides virtual private servers (they call each server a droplet), which means that you can pay $5/month to have your own server ‘in the cloud’ that you can access from anywhere and host anything on. Check out my DO droplet to see it in action! Use my referral link to get $10 in credits, which is enough to give you a private server for your first 2 months. I only found out about DO a couple of months ago when I asked my supervisor, Jenny Bryan, if there was a way for me to do some R-ing when I’m away from my machine. She told me that she doesn’t have a solution for me, but that I should check out DigitalOcean, so I did. And it turns out that it’s very convenient for hosting my own RStudio Server and anything else I’d like to host, and very affordable even for my student self. đŸ™‚ This post will cover how to set up a machine from scratch, setup R, RStudio Server, Shiny Server, and a few other helpful features on a brand new DO droplet (remember: droplet = your machine in the cloud). The tutorial might seem lengthy, but it’s actually very simple, I’m just breaking up every step into very fine details.

To Difference or Not To Difference?
In the textbook of time series analysis, we’ve been taught to difference the time series in order to have a stationary series, which can be justified by various plots and statistical tests.

Survival Analysis With Generalized Additive Models: Part V (stratified baseline hazards)
In the fifth part of this series we will examine the capabilities of Poisson GAMs to stratify the baseline hazard for survival analysis. In a stratified Cox model, the baseline hazard is not the same for all individuals in the study. Rather, it is assumed that the baseline hazard may differ between members of groups, even though it will be the same for members of the same group.

TidyR Challenge: Update
In my last post I described a data set that was a bit cumbersome to parse and I wanted to tidy it up before I could begin visually exploring. You know, the fun part. I wasn’t 100% happy with my solution so I candidly asked the internet to Help Me Do My Job.

Run Shiny app on a Ubuntu server on the Amazon Cloud
This guide is more for self reference than anything else. Since I struggled for two days trying to find all the correct setting to complete this task, gathering information from several websites, I decided to write a little guide on this blog so that if I want to do it again in the future and I do not remember anything (this happens a lot!!) at least I have something to resuscitate my memory.

Graduate Course on Classification Techniques, with R
This Monday, I will give a crash course on Classification Techniques with R (an overview). Slides are below (there are some typos in the pdf slides, and many graphs missing) and available in pdf format (incluing animated graphs)

Read A Block of Spreadsheet with R
The xlsx package provides the most intuitive interface with readColumns() function by explicitly defining the starting and the ending columns and rows.

Exchange data between R and the Google Maps API using Shiny
A couple of years ago I wrote a post about using Shiny to exchange data between the Google Maps API and R: http://…/interfacing-r-and-google-maps.html Back then as far as I remember Shiny did not allow a direct exchange of data between javascript, therefore I had to improvise and extract data indirectly using an external table. In other words, that work was not really good!! The new versions of Shiny however features a function to send data directly from javascript to R: Shiny.onInputChange This function can be used to communicate any data from the Google Maps API to R. Starting from this I thought about creating an example where I use the Google Maps API to draw a rectangle on the map, send the coordinates of the rectangle to R, create a grid of random point inside it and then plot them as markers on the map. This was I can exchange data back and forth from the two platforms.