Simple ROC plots with ggplot2 – Part 2

March 21, 2012
By
Simple ROC plots with ggplot2 – Part 2

In the first part of this article we built a function (rocdata) to calculate the co-ordinates for the ROC plot and its summary statistics. Now we need to actually produce the plot. I make most of my plots in ggplot2 because of it’s versatility. However there’s no reason why these plots couldn’t be produced

Read more »

Using R for a salary negotiation–an extension of decision tree models

March 21, 2012
By
Using R for a salary negotiation–an extension of decision tree models

Let’s say you are in the middle of a salary negotiation, and you want to know whether you should be aggressive in your offering or conservative. One way to help with the decision is to make a decision tree. We’ll work with the following assumptions: You are at a job currently making $50k You have the choices between...

Read more »

Simple ROC plots with ggplot2 – Part 1

March 21, 2012
By
Simple ROC plots with ggplot2 – Part 1

I was recently asked to summarise an analysis using a ROC (Receiver-operator characteristics) plot. R has a number of particularly good tools to produce ROC plots – ROCR, pROC and the Bioconductor package ROC to name a few. However I thought it would be a useful exercise

Read more »

Copy and paste small data sets into R

March 21, 2012
By
Copy and paste small data sets into R

How can I embed a small data set into my R code? That was the question I came across today, when I prepared my talk about Dynamical Systems in R with simecol for the forthcoming Cologne R user group meeting. I wanted to add all the R code of the talk t...

Read more »

Technical Analysis of Kansas Voter Registration Data

March 21, 2012
By

Computer Assisted Reporting This article describes technical analysis of the Kansas voter

Read more »

Data Analysis Training

March 20, 2012
By
Data Analysis Training

I'm training some of my colleagues on Big'ish data analysis this week. Here's how I'm running the class. Would love your ideas to make it better. CLASS OBJECTIVES (LEARNING OUTCOMES)After completion of the course, you will be able to:Understand concept...

Read more »

Geocode and reverse geocode your data using, R, JSON and Google Maps’ Geocoding API

March 20, 2012
By

Geocode and reverse geocode your data using, R, JSON and Google Maps' Geocoding APITo geocode and reverse geocode my data, I use Google's Geocoding service which returns the geocoded data in a JSON. I will recommend that you register with Google Maps A...

Read more »

New R User Group in Montréal

March 20, 2012
By

The Biology Department at McGill University in Québec, Canada has been running a series of R workshops since 2010. Past topics have included Generalized Additive Models, Linear Mixed-effects Models and a four-part Intro to R series -- follow the links and look at the bottom of each page for some very useful course notes. Over the past year the...

Read more »

Running OpenBUGS on a Mac Running OSX

March 20, 2012
By

After writing up my tutorial regarding getting WinBUGS running on a Mac in R, a friend sent me this fantastic simple tutorial on the same thing for OpenBUGS on a mac in R. So, for those that want it, install away! Looks a good bit simpler, actually! Tweet

Read more »

Applying Savitzky-Golay filters in “R”

March 20, 2012
By
Applying Savitzky-Golay filters in “R”

(This article was first published on NIR-Quimiometría, and kindly contributed to R-bloggers) When applying SG, we select a moving average window with an odd value “n” for the number of data points. SG fit a polynomial of “p” degree to this data points and give the value to the central point (this is the reason to have an odd...

Read more »

Citing R packages

March 20, 2012
By
Citing R packages

I’m not always careful in citing all the R packages I use. R actually has some rather nice built-in mechanisms to support this, so I really have no excuse. Here’s some quick examples: To cite the ouch package in publications use: Aaron A. King and Marguerite A. Butler (2009), ouch: Ornstein-Uhlenbeck models for phylogenetic comparative

Read more »

R/Finance 2012 Registration Open

March 20, 2012
By

You can find more information on the R/Finance conference website.  Hope to see you in Chicago in May!The registration for R/Finance 2012 -- which will take place May 11 and 12 in Chicago -- is NOW OPEN!Building on the success of the three previou...

Read more »

Monty Hall Simulations

March 20, 2012
By

Using R I'm doing a lot of simulations of the classic monty hall-problem and plotting multiple simulations using ggplot2.

Read more »

R / Finance 2012 Open for Registration

March 19, 2012
By

The annoucement below just went to the R-SIG-Finance list. More information is as usual the the R / Finance page: Now open for registrations: R / Finance 2012: Applied Finance with R May 11 and 12, 2012 Chicago, IL, USA The registration for R/Fi...

Read more »

how to work with character strings in r

March 19, 2012
By

(This article was first published on twotorials by anthony damico, and kindly contributed to R-bloggers) To leave a comment for the author, please follow the link and comment on his blog: twotorials by anthony damico. R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL,...

Read more »

how to add comments, save a script file, and make your work reproducible in r

March 19, 2012
By

click here to read more about reproducible research

Read more »

Survey in R course taught by Thomas Lumley at Statistics.com

March 19, 2012
By

Statistics.com is offering a new online course, “Survey Analysis in R,” debuts March 23 – April 20, with Dr. Thomas Lumley. Dr. Lumley is the creator of the R package “Survey,” and the author of the course text – “Complex Surveys: A Guide to Analysis Using R.” The course is suitable for those with some familiarity with R and...

Read more »

Revolution Newsletter: March 2012

March 19, 2012
By

The most recent edition of the Revolution Newsletter is out. The news section is below, and you can read the full March edition (with highlights from this blog and community events) online. You can subscribe to the Revolution Newsletter to get it monthly via email. Download Revolution R Enterprise, free for Academics. The new features of Revolution R Enterprise...

Read more »

Graphing between-subject confidence intervals for ANOVA

March 19, 2012
By

This is a quick follow up to my earlier post that discussed how to graph CIs for within-subjects (repeated measures) ANOVA designs. My forthcoming book Serious stats describes how to do this for between-subjects designs (a much simpler proble...

Read more »

Review of “The Origin of Financial Crises” by George Cooper

March 19, 2012
By
Review of “The Origin of Financial Crises” by George Cooper

The subtitle is “Central banks, credit bubbles and the efficient market fallacy”. Executive summary This is much too important of a book to remain as obscure as it is.  Besides, it is quite a fun read. It talks about two subjects: Why markets for goods and services tend toward equilibrium but financial markets do not. … Continue reading...

Read more »

Visualizing left-right government positions

March 19, 2012
By
Visualizing left-right government positions

How does the political landscape of Europe change over time? One way to approach this question is to map the socio-economic left-right positions of the governments in power. So let’s plot the changing ideological  positions of the governments using data … Continue reading →

Read more »

mvabund – new R pkg for multivariate abundance data

March 19, 2012
By
mvabund – new R pkg for multivariate abundance data

There is a new R package in town, mvabund, which does, as they say "statistical methods for analysing multivariate abundance data". The authors introduced the paper in an online early paper in Methods in Ecology and Evolution here, R package here. Th...

Read more »

Backtesting Asset Allocation portfolios

March 18, 2012
By
Backtesting Asset Allocation portfolios

In the last post, Portfolio Optimization: Specify constraints with GNU MathProg language, Paolo and MC raised a question: “How would you construct an equal risk contribution portfolio?” Unfortunately, this problem cannot be expressed as a Linear or Quadratic Programming problem. The outline for this post: I will show how Equal Risk Contribution portfolio can be

Read more »

Independent measures (between-subjects) ANOVA and displaying confidence intervals for differences in means

March 18, 2012
By
Independent measures (between-subjects) ANOVA and displaying confidence intervals for differences in means

In Chapter 2 (Confidence Intervals) of Serious stats I consider the problem of displaying confidence intervals (CIs) of a set of means (which I illustrate with the simple case of two independent means). Later, in Chapter 16 (Repeated Measures ANOVA), I consider the trickier problem of displaying of two or more means from paired or

Read more »

A graphical overview of your MySQL database

March 18, 2012
By
A graphical overview of your MySQL database

If you use MySQL, there’s a default schema called ‘information_schema‘ which contains lots of information about your schemas and tables among other things. Recently I wanted to know whether a table I use for storing the results of a large … Continue reading →

Read more »

Liking of apples – more than juiciness

March 18, 2012
By
Liking of apples – more than juiciness

In a previous blog it was shown using literature data that liking of apples was related to juiciness. However, there were some questionsIs the relation linear or slightly curved? The variation in liking around CJuiciness is large. Are more explana...

Read more »

Useful R snippets

March 18, 2012
By
Useful R snippets

In this post we collect several R one- or few-liners that we consider useful. As our minds tend to forget these little fragments we jot them down here so we will find them again. Indexing in nested loops Every once in a while I run a nested loop like the following one. Now if I

Read more »

How to read an excel file (dot xls and dot xlsx) into a data frame with r

March 17, 2012
By
How to read an excel file (dot xls and dot xlsx) into a data frame with r

how to read an excel file (dot xls and dot xlsx) into a data frame with r

Read more »

Predicting Marketing Campaign with R

March 17, 2012
By
Predicting Marketing Campaign with R

In my last blog I created a mechanism to fetch data from Salesforce using rJava and SOQL. In this blog I am going to use that mechanism to fetch ad campaign data from salesforce and predict future ad campaign sales using R Let us assume that Salesforce has campaign data for last eight quarters.  This

Read more »