R: Command Line Calculator using Rscript

June 18, 2010
By

I currently use an awesome little bash trick to get a command line calculator that was posted on lifehacker, and that I blogged about previously.calc(){ awk "BEGIN{ print $* }" ;}You just add this to your .bashrc file and then you can use it ...

Read more »

R Commander – linear regression

June 18, 2010
By
R Commander – linear regression

We can fit various linear regression models using the R Commander GUI which also provides various ways to consider the model diagnostics to determine whether we need to consider a different model. Fast Tube by Casper The “Statistics” menu provides access to various statistical models via the “Fit models” sub-menu including: Linear regression – the simplest scenario with

Read more »

Occupational Wage Comparison Plotted in R

June 17, 2010
By
Occupational Wage Comparison Plotted in R

Ever have conversations with your kids about what they are going to do with their life? Still trying to figure out what you are going to do with yours?Best to not starve...The chart above represents the percentage of each occupation that earn a given h...

Read more »

Do Not Log-Transform Count Data, Bitches!

June 17, 2010
By
Do Not Log-Transform Count Data, Bitches!

OK, so, the title of this article is actually Do not log-transform count data, but, as @ascidacea mentioned, you just can’t resist adding the “bitches” to the end. Onwards. If you’re like me, when you learned experimental stats, you were taught to worship at the throne of the Normal Distribution. Always check your data and

Read more »

Stack exchange for statistical analysis needs you!

June 17, 2010
By
Stack exchange for statistical analysis needs you!

The proposal to create a StackExchange site for statistical analysis is steadily moving forward. We have now completed the scoping stage which involved finding enough people willing to express an interest in the idea, and voting on some example questions to define what is allowed and what is not allowed on the site. The on-topic

Read more »

Chart the U.S. Gross National Product with the Federal Reserve API

June 17, 2010
By
Chart the U.S. Gross National Product with the Federal Reserve API

The Federal Reserve of St. Louis has an amazing amount of economic data available through their API. You need to apply for an API key, and once you have been approved you include your API key as URL parameter to access your data. api_key='YOUR API KE...

Read more »

Installing Ruby on Linux as a User other than root

June 17, 2010
By
Installing Ruby on Linux as a User other than root

Ruby is best known as the language behind the rails web application framework. However, it is a very flexible general purpose language that can be used for tasks of direct interest to R Developers (parsing files, interacting with databases, processing...

Read more »

Playing with Primes in R (Part II)

June 17, 2010
By
Playing with Primes in R (Part II)

Popping Part III off the stack—where I ended up unexpectedly discovering that the primes and primlist functions are broken in the schoolmath package on CRAN—let's see what prime numbers look like when computed correctly in R. To do this, I've had to roll my own prime number generating function.Personalizing primes in RFor what I want...

Read more »

Playing with Primes in R (Part II)

June 17, 2010
By
Playing with Primes in R (Part II)

Popping Part III off the stack—where I ended up unexpectedly discovering that the primes and primlist functions are broken in the schoolmath package on CRAN—let's see what prime numbers look like when computed correctly in R. To do this, I've had to roll my own prime number generating function.Personalizing primes in RFor what I want...

Read more »

Messing with R packages

June 17, 2010
By

This was really frustrating. I’m trying to modify a package from Matt Johnson and although I could get the package he sent me to install flawlessly, I couldn’t un-tar it, make a change, re-tar it, and then R CMD INSTALL … Continue reading →

Read more »

Shrinking R’s PDF output

June 17, 2010
By

R is great for graphics, but I've found that the PDF's R produces when drawing large plots can be extremely large. This is especially common when using spplot() to plot a large raster. I've made a 15 page PDF full of rasters that was hundreds of MB in size.  Obviously I don't need all the detail (every pixel of...

Read more »

Shrinking R’s PDF output

June 17, 2010
By
Shrinking R’s PDF output

R is great for graphics, but I've found that the PDF's R produces when drawing large plots can be extremely large. This is especially common when using spplot() to plot a large raster. I've made a 15 page PDF full of rasters that was hundreds of MB in ...

Read more »

A new Q&A website for Data-Analysis (based on StackOverFlow engine) – is waiting for you

June 17, 2010
By
A new Q&A website for Data-Analysis (based on StackOverFlow engine) – is waiting for you

What is the StackOverFlow Q&A website about? StackOverFlow.com (“SO” for short) is a programming Q & A site that’s free. Free to ask questions, free to answer questions, free to read. Free, And fast. For the R community, SO offers a growing database of R related questions and answer (click the link to check them out). You might be asking yourself what’s...

Read more »

Learning R

June 17, 2010
By

When R is brought up as a possibility for doing statistics or data mining or any sort of predictive analytics among non R users, someone will invariably point out that R has a “steep learning curve”, and the response among those gathered usually includes a significant amount of head nodding. Even those who have put in heroic efforts to...

Read more »

Comparing standard R with Revoutions for performance

June 17, 2010
By
Comparing standard R with Revoutions for performance

Following on from my previous post about improving performance of R by linking with optimized linear algebra libraries, I thought it would be useful to try out the five benchmarks Revolutions Analytics have on their Revolutionary Performance pages.

Read more »

Comparing standard R with Revoutions for performance

June 17, 2010
By
Comparing standard R with Revoutions for performance

Following on from my previous post about improving performance of R by linking with optimized linear algebra libraries, I thought it would be useful to try out the five benchmarks Revolutions Analytics have on their Revolutionary Performance pages.

Read more »

Shrinking R’s PDF output

June 17, 2010
By

R is great for graphics, but I've found that the PDF's R produces when drawing large plots can be extremely large. This is especially common when using spplot() to plot a large raster. I've made a 15 page PDF full of rasters that was hundreds of MB in size.  Obviously I don't need all the detail (every pixel of...

Read more »

Calling Ruby, Perl or Python from R

June 16, 2010
By
Calling Ruby, Perl or Python from R

If you want to interact with other programming languages from R, there are various packages and bindings available. These packages provide a pretty high degree of integration between the langages and allow you to pass objects back and forth seemlessl...

Read more »

Conferenza a Padova

June 16, 2010
By
Conferenza a Padova

Today and tomorrow, I am attending the annual Italian statistical society meeting. While I appreciate very much the invitation, as well as the opportunity to walk through  Padova and Venezia for a short (and alas rainy!) hour on the way there (leaving home at 8am, walking in Venezia at noon!), I am rather skeptical of

Read more »

Mary, Chloe, and Miriam at breakfast

June 16, 2010
By
Mary, Chloe, and Miriam at breakfast

Read more »

R-help follow-up: truncated exponential

June 16, 2010
By
R-help follow-up: truncated exponential

I recently posted the message below with regard to sampling from the truncated exponential distribution. I left out the derivation of the CDF (mostly because text math is ugly), so I’ve included it here. There is also a short JSS article about truncated distributions in R. This problem in particular may likely be found in

Read more »

R Sapply Problem

Any expert in R please educates me. I have got a problem about the sapply (or lapply), it made me headache for over two hours.As "for loop" is very slow in R, we should try best to avoid using it, and to use vectorization instead. sapply is designed for this, for example, instead of:for (i in 1:10) {z <-...

Read more »

R Commander – hypothesis testing

June 16, 2010
By
R Commander – hypothesis testing

The R Commander GUI can be used to perform classical hypothesis testing. There are menu options to undertake the variants on the t-test as well as tests on proportions or equality of variances for two samples of data. Fast Tube by Casper The “Statistics” menu provides access to various hypothesis tests via the “Means” sub-menu including: Single sample

Read more »

The distribution of online data usage

June 16, 2010
By
The distribution of online data usage

AT&T has recently announced it will no longer offer unlimited data plans for new iPhone users in the US, and now some carriers in the UK have followed suit. In each case, the providers claim that only a very small number of users actually use enough data to warrant an unlimited plan, and most users use relatively little and...

Read more »

Date and Time in R

June 15, 2010
By
Date and Time in R

The following are a few date and time functions that I needed to figure out early on when working with R.We will start when we are... the current system date.Sys.Date()Notice that this function returns a Date object.class(Date)A string in this format i...

Read more »

Welcome guest blogger, Joseph Rickert

June 15, 2010
By

I'm about to head out for a two-week holiday, so I'll be off the grid for a little while. But I have queued up some (hopefully!) interesting stories to auto-post while I'm away, so there'll still be plenty to read every weekday as usual here on the blog. Also joining us for the next couple of weeks is guest...

Read more »

Updated SoilWeb for the iPhone + Alpha Android Version

June 15, 2010
By

Major updates to the SoilWeb iPhone Application. read more

Read more »

Statistical Analysis and Visualization of the Drug War in Mexico

June 15, 2010
By
Statistical Analysis and Visualization of the Drug War in Mexico

On December 11, 2006 Felipe Calderon, as the first significant act of his presidency, sent the army to his home state of Michoacan. He claimed that it was to regain control of territories lost to the drug cartels, and indeed, a new cartel had started operating in Michocan. But the fact that he won the election by the slim margin of...

Read more »

Statistical Analysis and Visualization of the Drug War in Mexico

June 15, 2010
By
Statistical Analysis and Visualization of the Drug War in Mexico

On December 11, 2006 Felipe Calderon, as the first significant act of his presidency, sent the army to his home state of Michoacan. He claimed that it was to regain control of territories lost to the drug cartels, and indeed, a new cartel had started operating in Michocan. But the fact that he won the election by the slim margin of...

Read more »