Data science and visualization

A collection of 16 posts

"Data science and visualization" Stories Page 1 of 2  

Choosing colors for charts: examples and references

After ColorBrewer, now a very popular helper, what's next? Using these two tools, I stored several colors I want to use in my charts made in...

Out of sample predictions from OLS regressions: a K-folds tutorial in R

Evaluating predictions out of sample, OOS. Splitting datasets into training and test, holdout data using R....

Pre-processing text data with tm, quanteda & tidytext packages

Suppose you start with some sentences / passages / documents, and you want to pre-process the corpus before generating a document-term matrix (DTM, or DFM). This post will...

Working more efficiently with RStudio

For most of social science work Stata is all we "need". But it costs money, it's not friendly if you need to show model...

NAs in R: some warnings (and a worked example; calculating standard deviations)

This post shows why is.na and !is.na are not ideal approaches to “clean” a dataset with missing values when we want to compute summary...

What every STATA user needs to know - how missing values are treated

This is a post for people who are learning Stata. A common source of mistakes is generating a binary variable that should classify observations according to...

How to talk honestly about your (descriptive) regression

After running a regression, even if you just want to look at empirical correlations (i.e. you do not claim observed associations are causal) you will...

Using STATA: Bar charts with multiple groups using by() and over()

Let's compare Q1 GDP growth vs. the rest of each year, starting in 2009: Here is the code to make the above chart: graph bar ann_...

Data visualization principle: Does the chart needs to be interactive?

Re-posting a reminder that: Yes, interactive charts can be engaging. But many viewers will not see the data that is not shown by default. It can...

R Shiny app: Line charts for distinct sub-samples

Tutorial: reproducing a fiscal chart A few days ago, I posted a chart that looked like this [static screenshot below] The dataset is posted at: https:...

Global growth: How much slower without China? (rCharts post)

A simple growth chart coded with rCharts var chartParams = { "element": "globalGrowth", "width": 800, "height": 400, "xkey": "year", "ykeys": [ "gr_w", "gr_noChina" ], "data": [ { "year": "2005", "gr_...

Page 1 of 2