Andy Field just tweeted this:
All posts in category news
Posted by Thom on July 2, 2012
For an hour or so earlier today Serious Stats was #1 in the amazon.co.uk sales rank for the category:
Books > Health, Family & Lifestyle > Psychology & Psychiatry > Methodology > Statistics
As of writing the rank has dropped to #3 (but I’m still quite excited – even though I know this may not imply large numbers of pre-orders).
They have also increased the discount on pre-orders to 36%. The book should also be available for pre-order in other countries (though I’ve only checked the US store), but for some reason the discount is not as generous there.
If you can’t get hold of the item in your country, bookdepository.com does free worldwide delivery (to most countries as far as I can tell). I’ve used them to ship gifts to friends and family overseas and they seem pretty reliable (and also offer pretty good discounts).
Posted by Thom on May 29, 2012
Whilst writing the book the latest version of R changed several times. Although I started on an earlier version, the bulk of the book was written with 2.11 and it was finished under R 2.12. The final version of the R scripts were therefore run and checked using R 2.12 and, in the main, the most recent packages versions for R 2.12.
When it came to proof read R 2.13 was already out and therefore most of the examples were also checked with version, but I stuck with R 2.12 on my home and work machines until last week.
In general I don’t see the point of updating to a new version number if everything is working fine. One advantage of this approach is that the version I install will usually have bugs from the initial release already ironed out. That said, new versions of R have (in my experience) been very stable.
I tend to download the version only when I fall several versions behind or if it is a requirement for a new package or package version. On this occasion it turned out that the latest version of the ordinal package (for fitting ordered logistic regression and multilevel ordered logistic regression models). There are two main drawbacks with updating. The first is reinstalling all your favourite package libraries (and generally getting it set up how you like it). The second is dealing with changes in the way R behaves.
For re-installing all my packages I use a very crude system. For any given platform (Mac OS, Windows or Linux) there are cleverer solutions (that you can find via google). My solution works across cross-platform and is fairly robust, if inelegant. I simply keep an R script with a number of install.packages() commands such as:
install.packages(‘lme4′, ‘exactci’, ‘pwr’, ‘arm’)
I run these in batches after installing the new R version. I find this useful because I’m forever installing R on different machines (so far Mac OS or Windows) at work (e.g., for teaching or if working away from the office or on a borrowed machine). I can also comment the file (e.g., to note if there are issues with any of the packages under a particular version of R). This usually suffices for me as I usually run a ‘vanilla’ set-up without customization. It would be more efficient for me to customize my set-up, but for teaching purposes I find it helps not to do that. Likewise, I tend to work with a clean workspace (and use a script file to save R code that creates my workspaces). I should stress that this isn’t advice – and I would work differently myself if I didn’t use R so much for teaching.
One of the first things that happened after installing R 2.15 was that some of my own functions started producing warnings. R warnings can be pretty scary for new users but are generally benign. Some of them are there to detect behaviour associated with common R errors or common statistical errors (and thus give you a chance to check your work). Others alert you to non-standard behaviour from a function in R (e.g., changing the procedure it uses when sample sizes are small). Yet others offer tips on writing better R code. Only very rarely are they an indication that something has gone badly wrong.
Thus most R warnings are slightly annoying but potentially useful. In my case R 2.15 disliked a number of my functions of the form:
The precise warning was:
mean() is deprecated.
Use colMeans() or sapply(*, mean) instead.
All the functions worked just fine, but (after my initial irritation had receded) I realize that colMeans() is a much better function. It is more efficient but, even better, it is obvious that it calculates the means of the columns of a data frame or matrix. With the more general mean() function it is not immediately obvious what will happen when called with a data frame as an argument. It is also trivial to infer that rowMeans() calculates the row means.
I have now re-written a number of functions to deal with this problem and to make a few other minor changes. The latest version of my functions can be loaded with the call:
I will try and keep this file up-to-date with recent versions of R and correct any bugs as they are detected.
The functions can be downloaded as a text file from:
Posted by Thom on May 27, 2012
UPDATE: Some problems arose with my previous host so I have now updated the links here and elsewhere on the blog.
The companion web site for Serious Stats has a zip file with R scripts for each chapter. This contains examples of R code and and all my functions from the book (and a few extras). This is a convenient form for working through the examples. However, if you just want to access the functions it is more convenient to load them all in at once.
The functions can be downloaded as a text file from:
More conveniently, you can load them directly into R with the following call:
In addition to the Serious Stats functions, a number of other functions are contained in the text file. These include functions published on this blog for comparing correlations or confidence intervals for independent measures ANOVA and functions my paper on confidence intervals for repeated measures ANOVA.
Posted by Thom on March 26, 2012
The companion web site for Serious stats is now live:
It includes a sample chapter (Chapter 15: Contrasts), data sets, R scripts for all the examples and supplementary material.
Posted by Thom on March 23, 2012
This is a blog to accompany my forthcoming book “Serious stats” published by Palgrave.
Baguley, T. (2012, in press). Serious stats: A guide to advanced statistics for the behavioral sciences. Basingstoke: Palgrave.
Posted by Thom on February 1, 2012