Welcome to STAT 540 (formerly STAT 517), Introduction to Statistical Computing. This page contains updates to the course syllabus, computer notes from class, homework assignments and important notices. Send any questions to grego@stat.sc.edu

- 2013 Syllabus
- Uploading assignments in Blackboard
- Base SAS Certification app
- Notices
- Exercises
- Class Exercise 1
- Class Exercise 2 and data set
- Class Exercise 3
- Class Exercise 4 and R workspace
- Class Exercise 5 and R workspace
- Class Exercise 6 and SAS program
- Class Exercise 7
- Class Exercise 8
- Class Exercise 9 and Excel worksheet
- Class Exercise 10

- Class Exercise 1
- Slides/Notes
- Introduction, R Chapters 1 and 2 (Introduction; Objects, Modes, Assignments)
- R Chapters 3 through 6 (Getting Help; Managing Your Objects; Getting Data into R; Getting Results out of R)
- R Chapters 7 through 8 (Arithmetic; Logical Objects and Conditional Execution)
- R Chapters 9 through 10 (Subsetting, Sorting and so on...; Iteration)
- R Chapter 11 (An Introduction to Graphics in R)
- R Chapter 12 (An Introduction to Function Writing)
- Monte Carlo simulation
- Scatterplot Smoothing (not currently used)
- SAS Chapter 1 (Getting Started Using SAS Software)
- SAS Chapter 2 (Getting Your Data into SAS)
- SAS Chapter 3 (Working with Your Data)
- SAS Chapter 4 (Sorting, Printing, and Summarizing Your Data)
- SAS Chapter 6 (Modifying and Combining SAS Data Sets)
- SAS Chapter 5 (Enhancing Your Output with ODS)
- SAS Chapter 7 (Writing Flexible Code with the SAS Macro Facility)
- SAS Chapters 5 and 7 supplement (PROC TEMPLATE, ODS Graphics and Macro application)
- SAS Chapter 8 (ODS Graphics)
- SAS Appendices (SQL)

- Introduction, R Chapters 1 and 2 (Introduction; Objects, Modes, Assignments)
- SAS code and notes
- SAS documentation
- Chapter 1 code
- Weather station code for Chapter 1 notes and Exercise 6.

- Weather station code for Chapter 1 notes and Exercise 6.
- Chapter 2 code
- Excel spreadsheet for Chapter 2 Import Wizard demonstration.
- SAS PROC IMPORT code in case Import Wizard fails.
- SAS code for holding an input line for a conditional execution of the rest of the input.
- Additional SAS code for holding an input line for a conditional execution of the rest of the input.
- SAS code with a variety of informats.
- SAS code and input file for reading a long record. Additional input file for long record with line breaks.
- David Hitchcock's SAS code and text file for reading in a college football scores data set.

- Excel spreadsheet for Chapter 2 Import Wizard demonstration.
- Chapter 3 code
- SAS code to manipulate character data.
- SAS code to demonstrate a simple IF statement, subsetting IF, and formatted PRINT.
- SAS code with a complicated IF-ELSE example.
- SAS code to demonstrate a subsetting IF.
- SAS code to experiment with DATE functions.
- David Hitchcock's SAS code demonstrating the use of the RETAIN statement using earthquake data.
- SAS code with an ARRAY example.
- SAS code to refer to a range of "unlike" input variables.

- SAS code to manipulate character data.
- Chapter 4 code
- SAS code to demonstrate Chapter 4 commands (TITLE, WHERE, LABEL, PROC PRINT)
- SAS code and SAS data set for a PROC SORT example.
- SAS code and comma-delimited text file demonstrating the use of the NODUPKEY option in PROC SORT.
- SAS code with a PROC SORT example that cleans up a PROC MEANS output file in preparation for a many-to-one merge.
- SAS code to hold a data line and print formatted labels in PROC FREQ.
- SAS code to group data with PROC FORMAT prior to a call to PROC FREQ.
- Simplified version of Don Edwards' SAS code and data set for straightforward PROC TABULATE call to motivate interest in PROC TABULATE projects.

- SAS code to demonstrate Chapter 4 commands (TITLE, WHERE, LABEL, PROC PRINT)
- Chapter 6 code
- SAS code using SET and OUTPUT to stack records in a SAS data set.
- SAS code for some simple set and merge commands.
- SAS code for a typical match-merge.
- SAS code for a match-merge with multiple input data sets.
- SAS code for a one-to-many match-merge.
- STAT 706 example SAS code and Excel data for several one-to-many match-merges. The Excel file should be read into WORK as SAS data set SPLITCOV.
- SAS code demonstraing the IN= option in MERGE statements.
- SAS code and SAS data set to generate multiple data sets with the OUTPUT statement.
- PROC TRANSPOSE SAS code using visual acuity data.
- SAS code to re-create the transposed data with another PROC TRANSPOSE.
- SAS code using Lidar data set to demonstrate use of FIRST.variable and LAST.variable when using BY groups.

- SAS code using SET and OUTPUT to stack records in a SAS data set.
- Chapter 5 code
- SAS code to create PDF documents by graphing Broad River data .
- SAS code demonstrating use of ODS TRACE and ODS SELECT.

- SAS code to create PDF documents by graphing Broad River data .
- Chapter 7 code
- SAS code for a couple demonstrations of the %LET command .
- SAS code demonstrating the use of %INCLUDE.
- SAS code demonstrating calculation of sampling probabilities from traffic intensity (upurban.csv) data.
- SAS code demonstrating a regression macro.
- SAS code demonstrating CALL SYMPUT and a non-macro language alternative.
- SAS code demonstrating CALL SYMPUT and %IF statements. Trial data sets with one , two and four groups.
- SAS code demonstrating CALL SYMPUT to simplify the sampling probabilities macro.
- SAS code and Excel spreadsheet to demonstrate templates and ODS Graphics.
- SAS code to edit template definitions.

- SAS code for a couple demonstrations of the %LET command .
- Chapter 8 code
- SAS code and Excel worksheet to construct bar charts with PROC SGPLOT.
- SAS code to construct histograms and box plots with PROC SGPLOT.
- R code for density estimation demonstration.
- SAS code and one of the data sets needed to construct scatter plots, time series plots, and smoothed scatter plots with PROC SGPLOT and PROC SGPANEL.
- R code for scatterplot smoothing demonstration.

- SAS code and Excel worksheet to construct bar charts with PROC SGPLOT.
- Supplemental SAS code
- SAS code and SPSS Data View , Variable View , and Value dialog box screen captures.
- SAS code for basic SQL commands , SQL subsetting , SQL table joins , and SQL editing.

- SAS code and SPSS Data View , Variable View , and Value dialog box screen captures.

- SAS documentation
- R code and notes
- Don Edward's R primer
- Quick-R primer
- Chapters 1-2 R code (Introduction; Objects, Modes, Assignments)
- Chapters 3-6 R code (Getting Help; Managing Your Objects; Getting Data into R; Getting Results out of R)
- Chapters 7-8 R code (Arithmetic; Logical Objects and Conditional Execution)
- Chapters 9-10 R code (Subsetting, Sorting and so on...; Iteration)
- Chapters 11-12 R code (Graphics; An Introduction to Function Writing)
- Don Edward's Two Sample Test code
- Gamblers Ruin R code
- Hit or Miss Integration R code
- R code to compare Hit or Miss MC to Class MC.
- Monte Carlo Simulation R code
- Scatterplot Smoothing R code

- Don Edward's R primer
- Data sets and other code
- Test 1
- Test 2
- Final Exam
- Final Exam 2007 ; Problem 1, Week 1 ; Problem 1, Week 2 ; Problem 1, Week 3 ; Problem 1 File list ; Problem 3 data set ; Problem 4 data set .
- Final Exam 2009 ; Excel workbook with all problem sets.
- Final Exam 2011 ; Excel workbook with all problem sets; Plot 1 and Plot 2 for Q2.
- Final Exam 2013 ; Excel workbook with all problem sets; Plot 1 and Plot 2 for Q2.

- Final Exam 2007 ; Problem 1, Week 1 ; Problem 1, Week 2 ; Problem 1, Week 3 ; Problem 1 File list ; Problem 3 data set ; Problem 4 data set .
- Project information

Return to Department of Statistics Home Page