My first thought was Emacs Speaks Statistics (ESS) to do this in Emacs via R, but I bet there are many alternatives.