## Using LaTeX for Math Formulas on the Web

April 20, 2011
By
$SS_{err}=\sum_i({y_i-\hat{y}_i})^2$

I love the idea of using R+LaTeX+Sweave for reproducible research. This is even easier now that R has a jazzy new IDE that supports Sweave syntax highlighting and automatic PDF generation.I know I'm going to take some flak for saying this, but let's be...

## Using LaTeX for Math Formulas on the Web

April 20, 2011
By

I love the idea of using R+LaTeX+Sweave for reproducible research. This is even easier now that R has a jazzy new IDE that supports Sweave syntax highlighting and automatic PDF generation. I know I'm going to take some flak for saying this, but let's ...

## Bootsrap Confidence Intervals, Stratified Bootstrap

April 20, 2011
By

Here's a worked example for comparing group averages with bootstrap confidence intervals and allowing for different subsample sizes by calling the strata argument within the bootstrap function.The data is set up analogous to an before-after impac...

## ComputerWorld on R for data analysis and visualization

April 20, 2011
By

ComputerWorld's feature today, 22 free tools for data visualization and analysis, suggests open-source R as the third entry on the list: What it does: R is a general statistical analysis platform (the authors call it an "environment") that runs on the command line. Need to find means, medians, standard deviations, correlations? R can handle that and much more, including...

## New Favorite Test of US Monetary Policy Limits

April 20, 2011
By

After a little additional thought, I discovered that my Death Spiral Warning Graph post can be improved through the isolation of the expected inflation component of US 10y yields provided by the US 10y yield – US 10y TIP yield.  Unfortunately, i...

April 20, 2011
By

Matthew Yglesias shares this graph from the Economist: I hate this graph. OK, sure, I don't hate hate hate hate it: it's not a 3-d exploding pie chart or anything. It's not misleading, it's just extremely difficult to read. Basically,...

## The R code for those time-use graphs

April 20, 2011
By

By popular demand, here's my R script for the time-use graphs:...

## Day #27 A lot of graphics in one place

April 20, 2011
By

assignment in R Today my internship-promotor gave me the assignment to create this chart in R. This means: I get a lot of data and put a certain column on a barchart for each plate. On top of that data, you place 2 errorbars. At first I thought, piece ...

April 20, 2011
By

For my sins, I have done more than my fair share of analysis in Excel. I am quite capable of building and maintaining 130Mb spreadsheets (I had a dozen of them for one client). Excel is pretty much installed everywhere, so it is sometimes the only way to get started getting commercial value of the data in the...

April 20, 2011
By

For my sins, I have done more than my fair share of analysis in Excel. I am quite capable of building and maintaining 130Mb spreadsheets (I had a dozen of them for one client). Excel is pretty much installed everywhere, so it is sometimes the only way...

April 20, 2011
By

For my sins, I have done more than my fair share of analysis in Excel. I am quite capable of building and maintaining 130Mb spreadsheets (I had a dozen of them for one client). Excel is pretty much installed everywhere, so it is sometimes the only way...

## Transaction cost analysis and pre-trade analysis

April 20, 2011
By

Transaction cost analysis (TCA) is the framework to achieve best execution in trading context. TCA can be split into three groups: pre-trade analysis, intraday analysis, and post-trade measurement. Pre-trade analysis allows us to get insight about the future volatility of the price, forecast intra-day and daily volumes, market impact. It evaluates all strategies and advises

## Custom Labels for Ordination Diagram

April 20, 2011
By

Here is how you do custom labels, hull, spider in a vegan ordination diagram: Read more »

## Aggregate Function in R: Making your life easier, one mean at a time

April 20, 2011
By

I previously posted about calculating medians using R. I used tapply to do it, but I’ve since found something that feels easier to use (at least to me). ?Download download.txt1 2 3 aggregated_output = aggregate(DV ~ IV1 * IV2, data=data_to_aggregate, FUN=median) aggregated_output The above code saves an aggregated dataset to aggregated_output and gives you the

## Common Data Creation Commands

April 19, 2011
By

Here is a video tutorial where I go through some of the most commonly used commands in creating and manipulating data. As soon as I want to do more than just running a single regression, I use these commands more than any other set of commands (in som...

## Common Data Creation Commands

April 19, 2011
By

Here is a video tutorial where I go through some of the most commonly used commands in creating and manipulating data. As soon as I want to do more than just running a single regression, I use these commands more than any other set of commands (in som...

## Simplifying polygon shapefiles in R

April 19, 2011
By

Recently I downloaded the Crosby Code shapefile from Landcare Research's LRIS server for use in some publications I'm preparing. This shapefile is incredibly detailed, far more so than what I require. This detail means that it takes a while for the map to be plotted each time. As detail is less important for me than speed of...

## Simplifying polygon shapefiles in R

April 19, 2011
By

Recently I downloaded the Crosby Code shapefile from Landcare Research's LRIS server for use in some publications I'm preparing. This shapefile is incredibly detailed, far more so than what I require. This detail means that it takes a while for the map to be plotted each time. As detail is less important for me than speed of...

## 250 years of Bayes’ Theorem

April 19, 2011
By

The Reverend Thomas Bayes died 250 years ago this month. His grave, located near epidemiological centre of excellence St Mary's College, remains a point of pilgrimage for statisticians (of both Bayesian and Frequentist stripes) visiting London to this day. Because since then, Bayes Theorem has been the underpinning of predictive analytics applications from spam detection to medical alerts. There...

## How Kaggle competitors use R

April 19, 2011
By

The competitive data prediction competitions hosted by Kaggle require data scientists to bring their A game: the competition is intense, and competitors know in real time from the daily leaderboards how their predictions compare in accuracy to those of their rivals. So it's no surprise that open-source R, the most powerful statistics language, is a common tool of choice...

## Barron’s Spring 2008 Big Money Poll

April 19, 2011
By

Barron's April 28, 2008, Cover Story "Back in the Pool" offers a great hindsight look at our wonderful foresight: “AND NOW, FOR SOME GOOD NEWS: THE OTHER SHOE isn't going to drop. After a winter of discontent marked by massive write-offs on Wall Str...

## Example 8.35: Grab true (not pseudo) random numbers; passing API URLs to functions or macros

April 19, 2011
By

Usually, we're content to use a pseudo-random number generator. But sometimes we may want numbers that are actually random-- an example might be for randomizing treatment status in a randomized controlled trial.The site Random.org provides truly rando...

## NBA, Logistic Regression, and Mean Substitution

April 19, 2011
By

I’m currently sitting at about 32K feet above sea level on my way from Tampa International to DIA and my options … Continue reading →

## RStudio, Revolution Analytics and Deducer: A Tale of Three GUIs

April 19, 2011
By

I’m in the process of moving from SPSS to R at the moment. It’s not been the easiest of rides, but then learning how to do a core part of your job never really should be. It’s been fun, though – don’t get me wrong – it’s definitely been an adventure!! Here I’m going to

## Day #25-26 R is soo static!

April 19, 2011
By

Today I stumbled upon a very nice package called “rgl”. For documentation and demos, take a look at it’s website. Rgl is: quoted by rgl site itself: The rgl package is a visualization device system for R, using OpenGL as the rendering...

## Day #25-26 R is soo static!

April 19, 2011
By

Today I stumbled upon a very nice package called “rgl”. For documentation and demos, take a look at it’s website. Rgl is: quoted by rgl site itself: The rgl package is a visualization device system for R, using OpenGL as the rendering...

## Flu Trends

April 18, 2011
By

Not a model, but certainly Mickey Mousey: here’s some R code that plots Google’s US flu data:df <- read.csv(url("http://www.google.org/flutrends/us/data.txt"), skip=11)df$Date <- as.Date(df$Date)dev.new(height=8, width=12)# Leave a thin outer...

## Mickey Mouse Models

April 18, 2011
By

My statistics professor once drew a little Markov chain on the board and called it “just a Mickey Mouse model,” because it was too simple to represent anything serious.