I visited http://www.stat.uiowa.edu/~rlenth/StatWeave/ and installed StatWeave according to the instructions. But my problem is that there are no Step by Step instructions given in the manual, and also that example .tex files are not provided so that I can check it. Test files are given with .odt and .swv extensions, and I don't know how to use them in the StatWeave. Any suggestions?

  • 1
    @user4898: Why not use Sweave or odfWeave?
    – daroczig
    Apr 22 '11 at 13:48
  • One advantage of StatWeave is that is works with many different mathematical programs, including Stata, SAS, Maple, etc. not just R. If the OP is only using R, then Sweave is probably fine.
    – Alan Munn
    Sep 24 '11 at 21:47

I assume that you're interested in R, since you tagged your question with it. Also, I think you're interested in processing a tex file. In this case, as suggested by @daroczig, it is worth giving a try to Sweave.

The following works for me, at least with the R statistical package (I don't have SAS, but I works with Stata on my Mac OS 10.6). I just followed the on-line manual, §4.1 (pp. 6-7).

\RweaveOpts{prompt="> "}

\section{StatWeave example using R}

Here are some fake data:

x <- replicate(3, rnorm(100))

The dataset is of size \Rexpr{nrow(x)}.
Here is the results of the call to \verb|summary(x)|:


The above file, say 1.tex, might be compiled with

$ statweave --weave 1.tex

providing statweave is in your path. It generate the file 1.pdf which is shown below:

enter image description here

I installed statweave some time ago, and I just followed the instructions from the install jar file (run java -jar statweave.jar: it will install binaries in the specified directory, LaTeX style file and OpenOffice templates, and finally it asks you to check for external tools--R, Stata, SAS, Matlab, etc.--you want to enable).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.