Category Archives: Probability & Statistics

Public support for tax cuts, and David Brooks’ social science naivete

David Brooks has just written approvingly of Obama’s capitulation to Republicans on tax cuts for the wealthy.  He cites the most recent Gallup poll’s estimate that 67% of independents and 52% of Democrats support extending all the tax cuts.  (In this poll, the average support over all political persuasions was 66%.) But you would think […]

cacheSweave heads-up

I love Sweave for writing LaTeX documents with embedded R code, and R’s cacheSweave package helps tremendously in avoiding repetition of time-consuming computations.  (Thank you, Roger Peng, for writing cacheSweave!)  One catch that is evident from a careful perusal of the cacheSweave vignette but which I keep forgetting is that cacheSweave will not cache R […]

R sub() backslash gotcha

One of the things I do to my Sweave output is to make scientific notation more transparent.  I have a special R function for this which I use in my Sweave documents: myFormat <- function(…) { tmp <- format(…) return(sub(“e(.*)”,”\\\\\\\\times 10^{\\1}”,tmp)) } Note in particular the ridiculous number of backslashes required in the call to […]

How silent coercion steepens R’s learning curve

People often ask me about the relative merits of R versus other statistics & mathematical programming environments (Matlab, SPSS, and so forth).  While I love R and use it almost every day, I always insist that it has a(n unnecessarily) steep learning curve and can bite you in ways that are hard to recognize.  I […]