ggplot2
13 posts
Creating a typical textbook illustration of statistical power using either ggplot or base graphics
A common way of illustrating the idea behind statistical power in null hypothesis significance testing, is by plotting the sampling distributions of the null hypothesis and the alternative hypothesis. Typically, these illustrations highlight the regions that correspond to making a type II error, type I error and correctly rejecting the null hypothesis (i.e. the test’s power). In this post I will show how to create such “power plots” using both ggplot and R’s base graphics.
Working with shapefiles, projections and world maps in ggplot
In this post I show some different examples of how to work with map projections and how to plot the maps using ggplot. Many maps that are using the default projection are shown in the longlat-format, which is far from optimal. Here I show how to use either the Robinson or Winkel Tripel projection.
Analytical and simulation-based power analyses for mixed-design ANOVAs
In this post I show some R-examples on how to perform power analyses for mixed-design ANOVAs. The first example is analytical—and adapted from formulas used in G*Power (Faul et al., 2007), and the second example is a Monte Carlo simulation.
PubMed publications in 2011 by 202 world countries: who’s the winner?
Which country had the most PubMed citations in 2011? To find out I used R statistical software to analyze the affiliation of 986 427 articles
How to download complete XML records from PubMed and extract data
Yesterday I wrote an article that looked at the top 20 Cognitive Behavior Therapy journals with the most publications; today I will explain how I did it with R.
More PubMed data mining: looking at top 20 CBT journals
In this short article I present some data of the top 20 Cognitive Behavior Therapy (CBT) journals with the most PubMed publications, and compare that to data from 2010 and 2011.
Short R script to plot effect sizes (Cohen's d) and shade overlapping area
In this short post I take a look at how to use R and ggplot2 to visualize effect sizes (Cohen’s d) and how to shade the overlapping area of two distributions.
An R Script to Automatically download PubMed Citation Counts By Year of publication
An R script that queries PubMed’s E-utilities for the number of publications per year matching a search term, and plots the trends with ggplot2.
How to work with Google n-gram data sets in R using MySQL
In this R tutorial I show how to work with Google n-gram data sets with the help of MySQL and R. The complete R code is included in this post
Simple data mining and plotting data on a map with ggplot2
In this post I scrape data from a document were members of a group wrote were they live, and then plot the result using OpenStreetsMaps and ggplot2.
Ggplot2, PubMed citation frequency and DSM-IV Axis I disorders by year
I searched PubMed for several major DSM-IV disorders and downloaded the hits. Using ggplot2 I plotted the number of publications each year for each disorder
Using Ggplot2 to plot last.fm top 100 albums
I found out that last.fm had made data files available for their Best of 2011 artist list, and I thought it’d be a great opportunity to learn some more about data management in R and Ggplot2.
Monty Hall Simulations
In this post I use R to simulate the classic monty hall-problem and visualize the results with ggplot2.