A simple example of a statistical analysis using SASweave

The document is essentially written in LaTeX with SAS code inserted along the way in a special environment. The file is saved with an .SAStex extension.

\title{Simple SASweave usage example:\\ Analysis of Fisher's iris data}
\author{BERD Reproducible Research working group}
\SASweaveOpts{outputsize=\footnotesize, echo=false}


The famous (Fisher's or Anderson's) iris data set gives the measurements in centimeters of the variables
sepal length and width, and petal length and width, respectively, for 50 flowers from each of
3 species of iris.  The species are \emph{setosa, versicolor, virginica}.

First, let's run a simple ANOVA comparing the sepal lengths of the three species.
  PROC ANOVA DATA=sashelp.iris;
    CLASS Species;
    MODEL SepalLength = Species;

We can see that the three species have significantly different sepal lengths.  Figure~\ref{F:box} shows the corresponding

  PROC SGPLOT DATA=sashelp.iris;
    VBOX SepalLength / CATEGORY=Species;
\caption{Boxplot of sepal lengths by species.}\label{F:box}
This file can be compiled from a terminal window by calling

sasweave iris.SAStex   

This produces the following PDF file .

-- AnikoSzabo - 30 Dec 2010

Topic attachments
I Attachment Action Size Date Who Comment
iris.SAStexSAStex iris.SAStex manage 1 K 30 Dec 2010 - 21:32 UnknownUser SASweave script
iris.pdfpdf iris.pdf manage 150 K 30 Dec 2010 - 21:32 UnknownUser PDF file created by SASweave