# Problem in StatWeave

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?

-
@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).

\documentclass{article}
\usepackage{Statweave}
\begin{document}
\RweaveOpts{prompt="> "}

\section{StatWeave example using R}

Here are some fake data:

\begin{Rcode}{label=summary,saveout}
x <- replicate(3, rnorm(100))
summary(x)
\end{Rcode}

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

\recallout{summary}
\end{document}


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:

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).

-