Biostatistics 510 Fall 2003: Statistical Computing Packages

  • Click here to see the 2003 course syllabus.

  • Data Files. Zipped data files and example SAS command files can be downloaded here. Download to desktop and then double-click to extract data from the archive:

  • data.exe Archive containing SAS command files, Excel files, SPSS portable files, etc.
  • sasdata1.exe SAS version 6 data sets and version 8 data sets (.sd2, .sd7)
  • sasdata2.exe SAS version 8 data sets (.sas7bdat)
  • use_permdata.sas SAS commands written in class on to demonstrate using permanent data sets that were extracted from sasdata1.exe and sasdata2.exe. These commands can be downloaded and saved, and then opened into SAS to use the permanent SAS data sets.
  • save_sasgraphs.doc This document gives instructions on how to save SAS graphs created using SAS/GRAPH software or SAS/INSIGHT to files that can then be inserted into Word Documents or slide presentations.
  • Homework assignments can be downloaded here.
  • homework1_2003.doc Homework1. Create an Excel file, open in SAS, Create a permanent SAS data set, set up missing values, transformations, distributions of continuous variables, frequencies of categorical variables.
  • homework2_2003.doc Homework2. Import an Excel file. Read a permanent SAS data set. Combine two SAS data sets by appending them. Paired and independent samples t-tests.
  • heartrate_2002.xls Excel file data from 2002 to use in homework 2.
  • homework3_2003.doc Homework3. Use a permanent SAS data set. Create formats to be used in procedures. Oneway frequencies and crosstabulations. Calculation of chi-square tests, odds ratios and relative risks. McNemar's test of symmetry for matched proportions.
  • homework3B_2003.doc Homework3B. Read in raw data, using column locations. Set up missing value codes and special missing values. Read in a date and set up missing values for the date. Recodes of variables. Crosstabs of ordinal variables, tests for ordinal by ordinal variables.
  • homework4_2003.doc Homework4. Read in raw data, using column locations and setting up decimals. Logistic regression using categorical and continuous variables as predictors. Comparison of Proc Logistic and Proc Genmod.
  • Homework4key.doc Homework4 key. Writeup of homework 4 solutions. This can be used as a reference when working on the final project.
  • homework5_2003.doc Homework5. Simple linear regression. Regression using dummy variables, interaction, selection methods.
  • homework6_revised_2003.doc Homework6. Read an Excel file into SPSS. Do simple descriptive statistics, recodes and conditional recodes. Get an independent samples t-test and a paired t-test.
  • heartrate_2003.xls Excel file to use for Homework6. This is the data we collected from our class on the first day of class. Please use it as the data set for homework 6.
  • homework7_2003.doc Homework7. Crosstabs, Logistic Regression, Linear Regression and Anova problems using SPSS.
  • homework7key.doc Homework7. Key. This gives the SPSS commands, and a detailed writeup for this homework.
  • SAS examples are included below:

  • ttest.sas Shows how to do one-sample, two-sample and paired ttests. Nonparametric 2-sample tests (Wilcoxon rank-sum test, median test, Kolmogorov-Smirnoff test) are also illustrated. Data management tasks shown are: how to read in raw data using column locations, how to create subsets of data and merge files by matching on a key variable.
  • freq.sas Shows how to use formats for categorical variables, recode variables into categories, do oneway frequencies, crosstabulations and get appropriate statistics.
  • matchfreq.sas Shows how to get McNemar's test and Cohen's kappa for matched frequency data. Also shows how to create a table from counts.
  • logistic.sas Shows how to do a logistic regression with SAS, using Proc Logistic or Proc Genmod. Also shows the use of dummy variables in a logistic regression.
  • regress.sas Shows how to do simple and multiple regression with SAS Proc Reg. Also shows how to, get residuals and diagnostic plots. Also shows the use of dummy variables in a regression model and comparison of this model with an ANOVA model using Proc GLM.
  • regress_int.sas Shows how to do regression with interaction terms. Also shows how to center variables and then do the regression with interaction. Example of polynomial regression with interaction.
  • select.sas Shows how to do stepwise, backward, R-square and other types of regression selection methods. Shows an example of collinearity diagnostics and residual analysis using SAS.
  • anova.sas Examples using SAS Proc GLM. Shows how to do a simple oneway anova, and twoway anova with interactions. Analysis of covariance (ancova) is also illustrated. Comparison of regression with anova and ancova.
  • SPSS examples are included below:

  • SPSSInfo.doc Document giving a brief introduction to SPSS and how to use it. This is on the web for those who did not get it in class earlier.
  • descriptives_ttest.sps Shows how to read in raw data using SPSS, set up missing values, value labels, and list cases. How to do an independent samples t-test and a paired t-test.
  • crosstabs.sps Shows how to do crosstabs, get chi-square test of independence, odds ratios, relative risk, McNemar test, etc.
  • regression.sps Shows how to do simple and multiple regression using SPSS, including how to set up dummy variables, interactions, and quadratic terms.
  • anova_logistic.sps Shows how to run a oneway and twoway factorial anova, and a logistic regression, using SPSS.