R is a free statistics software which can be downloaded from www.r-project.org. After accessing the webpage, you can follow the setup instructions. Below are some basic things when you begin to use it. (Also note that R has been installed in some student computer labs already. To see which labs have it installed, check website at: http://www.doit.wisc.edu/computerlabs/software.asp ) First, you need to read the data. Take Exercise 83 in Chapter 4 as an Example. 1. Download the data set from the TA's course webpage: www.stat.wisc.edu/~cfan/st324-spring04.html, you need Data Sets for textbook problems in text files. 2. Set the path for work space to the file where you saved the data. If you use R in LINUX, go to the certain directory then open R; if you use R in Windows, click the menu File -> Change dir ... 3. Read the data to the workspace: > ex04.83 <- read.table("ex04-83.txt", skip = 1) 4. Rename the data column: > names(ex04.83) <- c("thickness") Alternatively, for file (e.g., named "rainfall.dat") consisting of data on a single variable x (i.e., one sample), as Exer 87 of Chap 4, you can use: > rainfall <- scan("rainfall.dat") Or, for small data set on a single variable x, you could enter directly as: > polymer <- c(418,421,421,422,425,427,431,434,437,439,442,445) After reading the data into the workspace, you can use it. 1. Plot a normal probability plot: from the help, we know 04.83 has a column of data named "thickness", so the command below generates the normal probability plot. > qqnorm(ex04.83$thickness) 2. Plot the histogram > hist(ex04.83$thickness) If alternative way of entering data into R is used, corresponding commands are just: qqnorm(rainfall) and hist(rainfall) More commands are availbale from Professor Reinsel's course webpage: http://www.stat.wisc.edu/~reinsel/stat324 Examples of useful commands include: summary(rainfall), boxplot(rainfall), mean(rainfall), var(rainfall), u <- log(rainfall), u <- sqrt(rainfall), u <- rainfall^(1/4), qqnorm(u), plot(rainfall,u), and so on In general, you can view the symbol "<-" as an `assignment' symbol. Then you need to save the plot. The commands below can be used either in Linux or Windows to save the plot as an .eps file: > postscript("plot.eps", horizontal=F, width=5, height=5) > qqnorm(ex04.83$thickness) > dev.off() Or you can change plot.eps to plot.ps, you can save the plot as a .ps file. In windows, you can save the plot to other forms of files: click the plot, then click the menu File -> Save as ... you can save it to other forms. Additionally, you can use > help.search(".....") to search things you want, just input the key word in .....place. You can also use > help(lm) to get information about the functions(here lm is just an example function). Type "q()" to quit R, that is, > q()