Mexico’s Economy

February 22, 2010
By
Mexico’s Economy

Yesterday the INEGI released the GDP figures for 2009, and since it was an annus horribilis for Mexico, I thought I'd put up a couple of charts. Looking through the Banco de Información Económica I found two series of historical seasonally adjusted GDP data available:GDP in 1993 pesos going from 1980 to 2007 GDP in 2003 pesos going...

Read more »

Mexico’s Economy

February 22, 2010
By
Mexico’s Economy

Yesterday the INEGI released the GDP figures for 2009, and since it was an annus horribilis for Mexico, I thought I'd put up a couple of charts. Looking through the Banco de Información Económica I found two series of historical seasonally adjusted GDP data available: GDP in 1993 pesos going from 1980 to 2007 GDP in 2003 pesos going...

Read more »

Time Series Calendar Heat Maps Using R

February 22, 2010
By
Time Series Calendar Heat Maps Using R

I came across an interesting blog that showcased Charting time series as calendar heat maps in R . It is based upon a great algorithm created by Paul Bleicher,CMO of Humedica. I'll let you link to the other blog to see more details on the background ...

Read more »

A quicky..

February 22, 2010
By

If you’re (and you should) interested in principal components then take a good look at this. The linked post will take you by hand to do everything from scratch. If you’re not in the mood then the dollowing R functions will help you. An example. # Generates sample matrix of five discrete clusters that have

Read more »

Sudoku via simulated annealing

February 22, 2010
By
Sudoku via simulated annealing

The Sudoku puzzle in this Sunday edition of Le Monde was horrendously difficult, so after spending one hour with only 4 entries filled, I decided to feed it to the simulated annealing R program I wrote while visiting SAMSI last year. The R program reached the exact (and only) solution in about 6000 iterations, as

Read more »

Siegel-Tukey: a Non-parametric test for equality in variability (R code)

February 22, 2010
By

Daniel Malter just shared on the R mailing list (link to the thread) his code for performing the Siegel-Tukey (Nonparametric) test for equality in variability. Excited about the find, I contacted Daniel asking if I could republish his code here, and he kindly replied “yes”. From here on I copy his note at full. p.s: (The R function can be downloaded from...

Read more »

Speeding up R code: A case study

February 22, 2010
By

On his Psychology and Statistics blog, Jeromy Anglim tells how he was analyzing some data from a skill acquisition experiment. Needing to run a custom R function across 1.3 million data points, Jeromy estimated it would take several hours for the computation to complete. So, Jeromy set out to optimise the code. First, he used the Rprof function, which...

Read more »

ggplot2 (qplot) text size

February 22, 2010
By

I'm trying to learn qplot in ggplot2, and I'm having a difficult time adjusting text sizes. Well, difficult doesn't descibe it - I can't do it at all. The manual tells me I can use cex just like in plot, but it's not working...

Read more »

Time-Space Cloud with R

February 22, 2010
By
Time-Space Cloud with R

Here comes another option to analyze a TimeSpace-Track with R. A lattice cloud plots every recorded trackpoint into a 3d-time-space-cube. As the data (planar point pattern) is marked with the daytime, cluster of everyday routines become visible. Here the direct comparison between a function of density and the time-space-cloud. Code example: cloud(time_hours ~ PPP_selection$x *

Read more »

Post hoc analysis for Friedman’s Test (R code)

February 22, 2010
By
Post hoc analysis for Friedman’s Test  (R code)

My goal in this post is to give an overview of Friedman’s Test and then offer R code to perform post hoc analysis on Friedman’s Test results. (The R function can be downloaded from here) Preface: What is Friedman’s Test Friedman test is a non-parametric randomized block analysis of variance. Which is to say it is a non-parametric version of...

Read more »

The R type system

February 21, 2010
By
The R type system

R is a weird beast. Through it's ancestor the S language, it claims a proud heritage reaching back to Bell Labs in the 1970's when S was created as an interactive wrapper around a set of statistical and numerical subroutines. As a programming language,...

Read more »

The truncated Poisson

February 21, 2010
By
The truncated Poisson

A common model for counts data is the Poisson. There are cases however that we only record positive counts, ie there is a truncation of 0. This is the truncated Poisson model. To study this model we only need the total counts and the sample size. This comes from the sufficient statistic principle as the

Read more »

Visual Interpretation of Principal Coordinates (of) Neighbor Matrices (PCNM)

February 21, 2010
By

Principal Coordinates (of) Neighbor Matrices (PCNM) is an interesting algorithm, developed by P. Borcard and P. Legendre at the University of Montreal, for the multi-scale analysis of spatial structure. This algorithm is typically applied to a distance matrix, computed from the coordinates where some environmental data were collected. The resulting "PCNM vectors" are commonly used to describe...

Read more »

Uh!

February 20, 2010
By

Didn't know this... a data 0 2 4 7+ 25 34 12 5 It's becoming clear that I have learned R in the most unstructured way...I always do it in two stages :ashamed:

Read more »

Design of Experiments – Block Designs

February 20, 2010
By
Design of Experiments – Block Designs

In many experiments where the investigator is comparing a set of treatments there is the possibility of one or more sources of variability in the experimental measurements that can be accounted for during the design stage of the experimentation. For example we might be investigating four different pieces of machinery using say two different operators,

Read more »

Does a Proclamation of Increased Workout Load Matter?

February 20, 2010
By
Does a Proclamation of Increased Workout Load Matter?

I forgot to link this up, but I have a new article (joint with our editor) over at Fantasy Ball Junkie. I run an extremely crude model to see if players who were mentioned in the media as having lost weight, gained muscle, gained speed, got eye surgery...

Read more »

Genetic Algorithm Systematic Trading Development — Part 3 (Python/VBA)

February 20, 2010
By
Genetic Algorithm Systematic Trading Development — Part 3  (Python/VBA)

As mentioned in prior posts, it is not possible to use the standard Weka GUI to instantiate a Genetic Algorithm, other than for feature selection. Part of the reason is that there is no generic algorithm to instantiate a fitness function. The same fl...

Read more »

lme4 stands 4 Linear mixed-effects…

February 19, 2010
By
lme4 stands 4 Linear mixed-effects…

There is a certain hype about mixed (and random) effects among statistician and analysts. You can show some love to Douglas Bates and Martin Maechler for maintaing the lme4 package for our cupid, R I copy the entity of the information of the projects page. Doxygen documentation of the underlying C functions is here. The

Read more »

R exam postprocessing

February 19, 2010
By
R exam postprocessing

Following my three-fold R exam of last month, I had a depressing afternoon meeting (with other faculty members) some students who had submitted R codes that were suspiciously close to other submitted R codes… In other words, it looked very  likely they had cheated. (A long-term issue with my R course, alas!) During this meeting,

Read more »

Where did all the bankers go?

February 19, 2010
By
Where did all the bankers go?

When Lehman Brothers, Bear Stearns and Merrill Lynch went kablooie in the financial crisis, what happened to all their employees? Thanks to the magic of LinkedIn data, their Chief Scientist DJ Patil can answer that question: they went to the surviving banks: It's a great, if tantalizingly incomplete visualization -- I'd love to see this with "Other (non-bank) employers"...

Read more »

How to call C++ from R with ease

February 19, 2010
By

At last night's meeting of the ACM Student Chapter at the University of Chicago, DIrk Eddelbuettel gave an invited guest lecture, "Programming with Data: Using and Extending R". I wasn't there myself, but Dirk has already posted his slides, and they're a treat. After a backgrounder on R itself (BTW, I'm flattered he referenced my Introduction to R talk...

Read more »

Newspaper flubs probability calculation

February 19, 2010
By

That headline's right up there with "Dog Bites Man" for shock value, but the Daily Express in the UK isn't one to let mere probability stand in the way of a sensational headline like "Mum beats odds of 50 million to one to have 3 babies on same date". As Ben Goldacre helpfully explains, the probability is actually a...

Read more »

U of C ACM talk

February 18, 2010
By

Fellow GSoC mentor and local ACM masterminder Borja Sotomayor had invited me a few months ago to give a talk at the ACM chapter at the University of Chicago. Today was the day, and the slides from the 50-minutes talk on R and extending R with Rcpp ar...

Read more »

U of C ACM talk

February 18, 2010
By

Fellow GSoC mentor and local ACM masterminder Borja Sotomayor had invited me a few months ago to give a talk at the ACM chapter at the University of Chicago. Today was the day, and the slides from the 50-minutes talk on R and extending R with Rcpp are ...

Read more »

U of C ACM talk

February 18, 2010
By

Fellow GSoC mentor and local ACM masterminder Borja Sotomayor had invited me a few months ago to give a talk at the ACM chapter at the University of Chicago. Today was the day, and the slides from the 50-minutes talk on R and extending R with Rcpp ar...

Read more »

Corruption indicators in Mexico

February 18, 2010
By
Corruption indicators in Mexico

As you can see there is only a slight positive correlation between the corruption index of the Mexican chapter of Transparency International and the percentage of students who cheated on the Grade 6 ENLACE test*. What I find surprising is that there is...

Read more »

Joining R-bloggers

February 18, 2010
By
Joining R-bloggers

Upon request by the blog administrator, Tal Galili, I have joined R-bloggers, which aggregate blog entries about R into a central place. I feel I have much more to learn than to teach about R (as can be seen from earlier comments on my R programs in Introducing Monte Carlo Methods with R). As I

Read more »

Press Enter in LyX Sweave as You Wish

February 18, 2010
By
Press Enter in LyX Sweave as You Wish

or a long time I’ve been wondering why we are not able to use Enter in the LyX Scrap environment which was set up by Gregor Gorjanc for Sweave. Two weeks ago, I (finally!) could not help asking Gregor about this issue, as I’m using “LyX + Sweave” more and more in my daily work.

Read more »

R IDE and debugger now available for 64-bit Windows; Webinar Tuesday

February 18, 2010
By

We've just upgraded REvolution R Enterprise to version 3.1 and expanded the available platforms to include 64-bit Windows. (REvolution R Enterprise is our subscription-based distribution of R.) This means that you can now create R programs on Windows that use all of your available memory, instead of being constrained by the 3Gb limit imposed by 32-bit versions of Windows....

Read more »