R: Good practice – adding footnotes to graphics

February 17, 2009
By
R: Good practice – adding footnotes to graphics

In some statistical programs there is the option available to attach a footnote to the graphical output that is created. This footnote may contain the name of the script or the file that produced the graphic, the author’s name and the date of creation. In SAS for example there is a footnote command to achieve

Read more »

Pearson vs. Spearman Correlation Coefficients

February 17, 2009
By
Pearson vs. Spearman Correlation Coefficients

One of the misuses of statistical terminology that annoys me most is the use of the word “correlation” to describe any variable that increases as another variable increases. This monotonic trend seems worth looking for, but it plainly is not what m...

Read more »

TTR_0.2 on CRAN

February 15, 2009
By
TTR_0.2 on CRAN

I am happy to announce a long-overdue update to the TTR package (version 0.2) is now on CRAN.This update represents a major milestone, as TTR useRs are no longer restricted to using matrix objects. TTR 0.2 uses xts internally, so all major time series...

Read more »

Single Letter Frequencies in English

February 15, 2009
By
Single Letter Frequencies in English

Every time that I read a paper that discusses the frequencies of single letters in English, I feel like I should sit down and calculate them for myself from a sample of English text. Today, I finally did. Here are the probabilities and negative log pro...

Read more »

R in SAS

February 15, 2009
By
R in SAS

Another "proof" that R definitely is one of mainstream statistical packages is the news that SAS will provide an interface to R via SAS/IML Studio (today known as SAS Stat Studio).

Read more »

R-Sessions 32: Forward.lmer: Basic stepwise function for mixed effects in R

February 13, 2009
By

Intended to be a customized solution, it may have grown to be a little more. forward.lmer is an early installment of a full stepwise function for mixed effects regression models in R-Project. I may put in some work to extend it, or I may not. Neverthel...

Read more »

New project: RInside

February 12, 2009
By

A few days ago, I started a new project called RInside by uploading a few files to a new SVN repo at R-Forge. RInside makes it easy to embed R into your own C++ application by hiding the nitty gritty of initializing an R interpreter behind a simple abstraction. More information is at a (currently pretty simple) RInside...

Read more »

Fitting Legendre (orthogonal) polynomials in R

February 10, 2009
By
Fitting Legendre (orthogonal) polynomials in R

Frederick Novomestky packaged a series of orthogonal polynomials in the orthopolynom R package. However, his functions can not be used "directly" in a statistical model, say in lm(). There is no need to use functions from orthopolynom package, since th...

Read more »

Positioning charts with fig and fin

February 9, 2009
By
Positioning charts with fig and fin

R offers several ways to spatially orient multiple graphs in a single graphing space. The layout() function and mfrow/mfcol parameter settings are adequate solutions for many tasks and allow the graphing space to be broken up into tabular or matrix-based arrangements. For more fine grained manipulation, the fig and fin parameter settings are available. This The post Positioning...

Read more »

Positioning charts with fig and fin

February 9, 2009
By

R offers several ways to spatially orient multiple graphs in a single graphing space. The layout() function and mfrow/mfcol parameter settings are adequate solutions for many tasks and allow the graphing space to be broken up into tabular or matrix-ba...

Read more »

Princeton Graduate Student Housing

February 8, 2009
By
Princeton Graduate Student Housing

For any Princeton graduate students who are interested, here’s the success rate for graduate students applying for school housing. These charts were built using the data from the 2008-2009 Room Draw Statistics pamphlet provided by the Division of Hou...

Read more »

Our new R package: R2jags

February 8, 2009
By

I have got emails occasionally from JAGS users, asking about our new R package: R2jags. Basically, R2jags runs JAGS via R and makes postanalysis easier to be done in R. Taking advantage of the functions...

Read more »

Our new R package: R2jags

February 8, 2009
By

I have got emails occasionally from JAGS users, asking about our new R package: R2jags. Basically, R2jags runs JAGS via R and makes postanalysis easier to be done in R. Taking advantage of the functions...

Read more »

Baby Got Stats!

February 8, 2009
By

I was completely tickled last year with the oh so amusing Statz Rappers. It kept me and my nerdy stats friends laughing for days. Rapping. Stats. The Internet. Good times. But little did I know that rapping about statistics was really just hitting its stride on youtube. This is Why We Plot began my trip

Read more »

ave

February 8, 2009
By

I discovered a new, very useful, R function yesterday: ave. This is what it does: “Subsets of ‘x‘ are averaged, where each subset consist of those observations with the same factor levels.” But interestingly, you can use any function other than average. The output of that function is set against each observation. I wanted

Read more »

R: Calculating all possible linear regression models for a given set of predictors

February 6, 2009
By
R: Calculating all possible linear regression models for a given set of predictors

Although the graphic at the left might not seem a 100% appropriate, it gives a hint to what I am about to do. I want to calculate all possible linear regression models with one dependent and several independent variables. I do not want to address bias and fitting issues or the question if this

Read more »

Analysis of Variance (ANOVA) using R

February 5, 2009
By
Analysis of Variance (ANOVA) using R

I found some useful websites showing examples of how to use R for various sorts of ANOVA (between, within, mixed designs, etc): Using R for Psychological Research Quick-R for SAS/SPSS/Stata users enjoy

Read more »

R-Sessions 31: Combining lmer output in a single table (UPDATED)

February 5, 2009
By

There are various ways of getting your output from R to your publication draft. Most of them are highly efficient, but unfortunately I couldn’t find a function that combines the output from several (lmer) models and presents it in a single table....

Read more »

If I Had a Text File, I’d Hack Regexes in the Morning

February 4, 2009
By
If I Had a Text File, I’d Hack Regexes in the Morning

Yesterday the topic of academic citation counts came up, so I decided that I should write up some tools for exploring cite counts. The first thing I did was to build a cheap screenscraper in Ruby for pulling citation count information from Google schol...

Read more »

Correct Datetime / POSIXct behaviour for R and kdb+

February 3, 2009
By

We have started to look into kdb+ as a possible high-performance column-store backend. Kx offers free trials -- and so I have played with this for a day or two, both the general system, data loads and dumps and in particular with the interface to R, Based on the few files (one C source with interface code, one R file to access the...

Read more »

Online R programming resources

February 2, 2009
By

R can legitimately be called both a programming language and a statistical package. Many books address both the programming and statistical components of R, but invariably the discussion of statistical topics is more detailed than the discussion of pr...

Read more »

Don’t group Figures in Word

Don’t group Figures in Word

One of my ongoing annoyances with Microsoft Word is its inability to handle figures in a consistent way. The last quirk I discovered is the following: if you group a figure with a textbox -- something often done for creating captions -- the print quali...

Read more »

A Handbook of Statistical Analyses Using R – Everitt and Hothorn (2006)

January 31, 2009
By

Title: A Handbook of Statistical Analyses Using RAuthor(s): Brian S. Torvitt; Torsten HothornPublisher/Date: Chapman & Hall/2006Statistics level: Intermediate to advancedProgramming level: Intermediate Overall recommendation: Highly recommended ...

Read more »

State-of-the-art in parallel computing with R: New paper

January 30, 2009
By

A few weeks ago, we finished a paper that surveys the current state of parallel computing with R. The paper was lead by Markus Schmidberger and written while he was visiting the Fred Hutchinson Cancer Research Center in Seattle. The co-authors are Martin Morgan, myself, Hao Yu, Luke Tierney and Ulrich Mansmann. The paper is now available as a technical report from LMU...

Read more »

Importing Generic Function from Other Package: A Tip on Writing a R Package

January 30, 2009
By

I did not know this and had to spend the whole week to figure out what's wrong with my code. I was updating the mi package. While I was doing code checking procedure, I always got a error message that I did not know what was going on. I remember last...

Read more »

Importing Generic Function from Other Package: A Tip on Writing a R Package

January 30, 2009
By

I did not know this and had to spend the whole week to figure out what's wrong with my code. I was updating the mi package. While I was doing code checking procedure, I always got a error message that I did not know what was going on. I remember last...

Read more »

Visualizing Eigenfactors

January 30, 2009
By

These interactive graphics are simply beautiful. And they just so happen to be profoundly informative about the structure of modern science as well. Here’s to the hope that we will see more work from Moritz Stefaner soon that shows how our aesthetic ...

Read more »

Runing R in the Command Mode in the Window system

January 29, 2009
By

Just when I am about to convert myself into a Linux user, I found this. Running R in the command mode in the Window system is much faster. Here is a simple test:in the Window interface:> system.time(rnorm(1000000)%*%rnorm(1000000)) user system elapsed 1.06 0.05 1.14 in the...

Read more »

Runing R in the Command Mode in the Window system

January 29, 2009
By

Just when I am about to convert myself into a Linux user, I found this. Running R in the command mode in the Window system is much faster. Here is a simple test:in the Window interface:> system.time(rnorm(1000000)%*%rnorm(1000000)) user system elapsed 1.06 0.05 1.14 in the...

Read more »