\documentclass{amsart} \documentclass{amsart} \title{Simple SASweave usage example:\\ Analysis of Fisher's iris data} \author{BERD Reproducible Research working group} \date{} \SASweaveOpts{outputsize=\footnotesize, echo=false} \begin{document} \maketitle 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. \begin{SAScode} PROC ANOVA DATA=sashelp.iris; ODS SELECT OverallANOVA; CLASS Species; MODEL SepalLength = Species; RUN; \end{SAScode} We can see that the three species have significantly different sepal lengths. Figure~\ref{F:box} shows the corresponding boxplot. \begin{figure} \begin{SAScode}{sgfig=1} PROC SGPLOT DATA=sashelp.iris; VBOX SepalLength / CATEGORY=Species; RUN; \end{SAScode} \caption{Boxplot of sepal lengths by species.}\label{F:box} \end{figure} \end{document}This file can be compiled from a terminal window by calling
sasweave iris.SAStexThis produces the following PDF file . -- AnikoSzabo - 30 Dec 2010
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
SAStex | |
manage | 1 K | 30 Dec 2010 - 21:32 | UnknownUser | SASweave script |
|
manage | 150 K | 30 Dec 2010 - 21:32 | UnknownUser | PDF file created by SASweave |