Welcome to Kristoffer Magnusson's blog about

R, STATISTICS, PSYCHOLOGY, OPEN SCIENCE, DATA VISUALIZATION

Visualizing a One-Way ANOVA using D3.js

A while ago I was playing around with the javascript package D3.js, and I began with this visualization—that I never really finished—of how a one-way ANOVA is calculated. I tried to make it look like a plot from ggplot2 except with interactive elements. Take a look at it after the jump

Are the Current Criteria for Empirically Supported Treatments Too Lenient?

The practice of classifying treatments as empirically supported has been widely debated for a long time. In this post I write about a recent article that raises several concerns and suggestions regarding the current use of EST criteria—which can be summarized as the current criteria being too lenient, something that I wholeheartedly agree with

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.

Cognitive behavioral therapy outperformed psychodynamic therapy on all outcomes in a randomized controlled trail

The dodo bird might be extinct in the real world but in the world of psychotherapy research it refuses to die. However, a group of German researchers recently put forward an article were they had randomized patients to either a PDT or CBT condition and measured the relative proficiency of the two orientations, and they found that their results delivered a convincing blow to the dodo bird verdict.

How to tell when error bars correspond to a significant p-value

Can you tell when error bars based on 95 % CIs or standard errors correspond to a significant p-value? Don’t fret if you think it’s hard, a study from 2005 showed that researchers in psychogoly, behavior neuroscience and medicine had a hard time judging when error bars from two independent groups signified a significant difference

The Higgs boson: 5-sigma and the concept of p-values

Why are physicists talking about 5-sigma, and what’s it got to do with statistics? In this short post I’ll explain what 5-sigma is and why it’s not a measure of how certain scientist are that they’ve found the Higgs boson

Effect of sample size on the accuracy of Cohen's d estimates (95 % CI)

When talking about confidence intervals, Jacob Cohen famously said: “I suspect that the main reason they are not reported is that they are so embarrassingly large!” (Cohen, 1994). In this post I’ll take a look at the relationship between the 95 % CI for Cohen’s d and it’s corresponding sample size.