Publications by John Johnson

Using R in consulting: playing nice with Microsoft Word

17.10.2008

As I use R more in consulting, I’m finding the need to make the quick transition from R to Microsoft products (usually Word) more serious. (I’m using a Windows platform, but I’m sure the challenges on the Mac would be similar.) I simply don’t have time to do the text manipulations necessary to convert text to Word tables, for ...

5182 sym

Another solution to the R to Word table problem

17.10.2008

Last time I used an HTML solution. This time, I create an RTF file: # function: my.rtf.table # purpose: convert a matrix, data.frame, or array into a rtf table # output: text for RTF, possibly written to a file # inputs: # tab - a table, dataframe, or array (needs rownames and colnames) # outfile - name of file (or console if NULL, ...

3273 sym

Causal inference and biostatistics

11.07.2009

I’ve been following the discussion on causal inference over at Gelman’s blog with quite a bit of interest. Of course, this is in response to Judea Pearl’s latest book on causal inference, which differs quite a bit from the theory that had been forwarded by Donald Rubin and his colleagues for the last 35 years or so.This is a the...

2255 sym

Working on a drug safety project

20.11.2009

In order to move some of my personal interests along, I have been trying to implement the methodology found in Berry and Berry’s article Accounting for Multiplicities in Assessing Drug Safety. This methodology uses the MedDRA hierarchy to improve the power of detecting damage to a particular organ. (The drawback, of course, is that ...

1541 sym

My implementation of Berry and Berry’s hierarchical Bayes algorithm for adverse events

20.11.2009

I’ve been working on this for quite some time (see here for a little background), so I’m pleased that it looks close to done at least as far as the core algorithm. It uses global variables for now, and I’m sure there are a couple of other bugs lurking, but here it is, after the jump.const.sqrt2pi <- sqrt(2*3.14159265358979) logi...

922 sym R (10347 sym/2 pcs)

R – not the epic fail we thought

16.04.2010

I usually like AnnMaria’s witty insight. I can relate to a lot of what she is saying. After all SAS and family life are large parts of my life, too. But you can imagine the reaction she provoked in saying the following:I know that R is free and I am actually a Unix fan and think Open Source software is a great idea. However, for me ...

2045 sym

Dona eis Python, whap!

15.01.2011

Well, I’m taking the plunge and learning Python. We’ll see how this goes. Then I’ll try NumPy (and SciPy, if it gets ported), and see of I can get R and Python talking. Related To leave a comment for the author, please follow the link and comment on their blog: Realizations in Biostatistics. R-bloggers.com offers daily e-ma...

594 sym

Ultraedit to R

21.01.2011

My favorite text editor on Windows is Ultraedit, but it does not have a nice interface to R in the same vein as Emacs/ESS, Tinn-R, or Eclipse. (I have never used Eclipse.) Ultraedit is powerful enough to submit whole R programs and even capture the output, but you cannot submit pieces and parts of programs.Until now. After one night of dusti...

1389 sym

More on Ultraedit to R

27.03.2011

I think I have found a superior solution to integrating Ultraedit and R. See my post over at IDM Users forum. Related To leave a comment for the author, please follow the link and comment on their blog: Realizations in Biostatistics. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many o...

535 sym

R to Word, revisited

12.09.2011

In a previous post (a long time ago) I discussed a way to get a R data frame into a Word table. The code in that entry was essentially a brute force way of wrapping R data in RTF code, but that RTF code was the bare minimum. There was no optimization of widths, or borders, or anything like that.There are a couple of other ways I can think of:Writ...

2797 sym