Monthly Archives: September 2011

A quick way to do row repeat and col repeat (rep.row, rep.col)

September 2, 2011
By
A quick way to do row repeat and col repeat (rep.row, rep.col)

Today I worked on a simulation program which require me to create a matrix by repeating the vector n times (both by row and by col). Even the task is extremely simple and only take 1 line to finish(10sec), I have to think about should the argument in rep be each or times and should

Read more »

Discussion thread on R vs SAS for businesses

September 2, 2011
By

There's an interesting discussion thread on LinkedIn going on now on the relative benefits of R versus SAS in the commercial sector. Oleg Okun kicks off the discussion with this question: Did anyone have to justify to a prospect/customer why R is better than SAS? What arguments did you provide? Did your prospect/customer agree with them? Why do you...

Read more »

Assessing the Forecasting Ability of Our Model

September 2, 2011
By
Assessing the Forecasting Ability of Our Model

Today we wish to see how our model would have faired forecasting the past 20 values of GDP. Why? Well ask yourself this: How can you know where your going, if you don't know where you've been? Once you understand please proceed on with the following post.First recall the trend portion that we have already accounted for:> t=(1:258)> t2=t^2> trendy= 892.656210 +...

Read more »

Part 2 of 3: Non-linear Optimization of Predictive Models with R

September 2, 2011
By

In my previous post, I was able to build a predictive model (simple linear model) to predict the gross margin % of an eCommerce site based on the promotional spend accross various paid channels.  I repeated the process for AOV (average order ...

Read more »

Using Google Spreadsheets as a Database Source for R

September 2, 2011
By
Using Google Spreadsheets as a Database Source for R

I couldn’t contain myself (other more pressing things to do, but…), so I just took a quick time out and a coffee to put together a quick and dirty R function that will let me run queries over Google spreadsheet data sources and essentially treat them as database tables (e.g. Using Google Spreadsheets as a

Read more »

Word Cloud from Blog RSS

September 2, 2011
By
Word Cloud from Blog RSS

Crazy busy  - no time to blog recently. Time enough for pretty pictures based upon previous words though...(thanks http://www.wordle.net).

Read more »

Fix missing dates with R

September 2, 2011
By
Fix missing dates with R

I have data on user access to a website. This log file (helpdesk log.csv) just contains the date of access, and how many accesses were counted. It would look like this:Date hits13-07-2011 214-07-2011 116-07-2011 317-07-2011 4...As you can see, for day...

Read more »

Density curve of histogram plot in R

September 1, 2011
By
Density curve of histogram plot in R

Ref: http://casoilresource.lawr.ucdavis.edu/drupal/book/export/html/23 To add density curve on a histogram, like the green curve above, use code below:#plot the distributionhist(slope, breaks=1000, freq=F, main=main, xlab="Slope Value (percent)", ...

Read more »

Le Monde puzzle [#738]

September 1, 2011
By
Le Monde puzzle [#738]

The Friday puzzle in Le Monde this week is about “friendly perfect squares”, namely perfect squares x2>10 and y2>10 with the same number of digits and such that, when drifting all digits of x2 by the same value a (modulo 10), one recovers y2. For instance, 121 is “friend” with 676. Here is my R

Read more »

Interactive graphics for data analysis

September 1, 2011
By
Interactive graphics for data analysis

I got a copy of Martin Theus and Simon Urbanek’s Interactive Graphics for Data Analysis a couple of years ago, whence it’s been sat on my bookshelf. Since I’ve recently become a self-proclaimed expert on interactive graphics I thought it was about time I read the thing. Which is exactly what I did last weekend

Read more »