Biostatistics 510: Statistical Computing Packages Information from Winter 2005

  • Click here to see the 2005 course syllabus.
  • missing_values_in_SPSS.doc This document gives information on missing values in SPSS and how to be sure that recodes work correctly. Please check it out.

    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.
  • homework1_data_510.pdf This pdf file contains a scan of the data from class. If you can't read it, please go to Melissa Karby and Valerie Wilson's office (room 4210 SPH II) and pick up a copy.
  • SAS commands for class handouts given can be accessed here.
  • descriptives.sas This command file includes SAS commands to import an Excel file to create a SAS data set, modify the data set to create new variables, and carry out simple descriptive statistics for continuous and categorical variables. It also includes commands that illustrate how to produce simple bar charts, histograms, and box and whisker plots.
  • descriptives.doc This document contains the SAS commands from the program above, plus the output in a Microsoft Word document.
  • ttest.sas This command file includes SAS commands to carry out two-sample, paired and one-sample t-tests using SAS, using a data set imported from Excel.
  • ttest.doc This document contains SAS commands illustrating how to do box and whisker plots to display the data for a t-test, and how to do a two-sample, paired and one-sample ttest in SAS. The output from these commands is also included in a Microsoft Word document.
  • freq.sas This command file includes SAS commands to set up formats for categorical variables, recode variables into categories, carry out oneway frequency tabulations and two-way and three-way cross-tabulations, and associated statistics.
  • frequencies.doc This document contains SAS commands and output for oneway frequency tabulations, two-way cross-tabulations, three-way cross-tabulations and associated statistics.
  • matchfreq.sas This command file includes SAS commands to carry out McNemar's test for matched samples, and calculate Cohen's kappa for agreement between raters.
  • matched_freq.doc This document contains SAS commands and output for twoway cross-tabulations for matched samples, including calculation of McNemar's test of symmetry and Cohen's kappa.
  • regress1.sas This command file shows how to set up a simple linear regression in SAS, and h ow to do a multiple regression using SAS. It also shows how to check for collinearity and do diagnostic plots.
  • regress1.doc This document contains SAS commands and output for simple linear regression and multiple regression, with diagnostic plots and checking for collinearity.
  • regress2.sas This SAS command file shows how to set up regression analyses with dummy variables for both ordinal and nominal categorical predictor variables.
  • regress2.doc This document contains SAS commands and output for regression using dummy variables for both ordinal and nominal categorical predictor variables.
  • logistic.doc This document contains SAS commands and output for logistic regression, using both continuous and categorical predictor variables, and stepwise selection of predictors.
  • logistic.sas These are the SAS commands that go with the handout on logistic regression.

  • Homework assignments can be accessed here.
  • homework1_2005.doc This homework is to import Excel files into SAS, save permanent SAS data sets, modify the data to create new variables and do simple descriptive statsitics.
  • homework1.sas These SAS commands are set up as a model for doing homework 1 using SAS.
  • homework2_2005.doc This homework is to read in permanent SAS data sets, merge them by id and do boxplots and t-tests.
  • homework2.sas These SAS commands are set up as a model for doing homework 2 using SAS.
  • homework3_2005.doc This homework is to read in a permanent SAS data set, create new variables, and carry out analyses on independent samples and matched samples.Note: the due date is Tuesday, February 8th, not Thursday. Also, note that only questions 1 through 7 are required for this homework.
  • homework3.sas These are the SAS commands to do homework 3.
  • notes_on_homework3.doc This document shows the SAS commands for homework 3, along with the output and some commentary.
  • homework4_2005.doc This homework requires calculating McNemar's test of symmetry to compare proportions for matched data, Cohen's kappa for inter-rater reliability on matched data, and a goodness of fit chi-square test for a one-way tabulation. Click here tonsil.sas to get the SAS code necessary to set up the data set, and run the cross-tabulation for Problem 6. Note that you will need to add the appropriate options in order to complete this problem using SAS.
  • homework4.sas These are the SAS commands to do homework 3.
  • homework4_notes_2005.doc This document shows the SAS commands for homework 4, along with the output and some commentary.
  • homework5_2005.doc This homework requires reading in a raw data file to create a SAS data set. There are problems involving correlation, scatter plots, regression analysis and regression diagnostic plots. The regression problems involve a simple regression, a multiple regression with collinearity, and reducing the collinearity in a model by deleting some variables.
  • Homework_5_Key.doc The key for homework 5. Answers are written out and discussed.
  • homework5.sas SAS commands for homework 5.
  • homework6_2005.doc This homework requires reading in a permanent SAS data set that was created for an earlier homework. It involves using dummy variables in a model, and using regression selection methods.
  • Homework_6_Key.doc Writeup of answers for Homework 6, along with explanations.
  • homework6.sas SAS commands for homework 6.
  • homework7_2005.doc This homework uses both categorical and continuous predictor variables in logistic regression models for a binary outcome variable. There is also a problem involving stepwise selection of a logistic regression model. Note: you should use SHOKTYPE as a class variable in question 3, and any other question where SHOKTYPE is a predictor. There is some revised wording in question 3 to reflect this. Also, for the pseudo R-square for each model, please report the maximum-rescaled R-square. The maximum-rescaled r-square (also called the Nagelkerke r-square), has a maximum value of 1.0, so it is comparable across models.
  • Homework_7_Key.doc Writeup of answers for Homework 7. Includes an explantation of how to interpret logistic regression coefficicients and odds ratios for continuous and categorical predictors. At the end of this writeup there is an illustration of how to interpret the odds ratio for a continuous variable as percent change in the odds, and how to estimate the effects of continuous variables using different units.
  • homework7.sas SAS commands for homework 7.
  • homework8_2005.doc This is SPSS homework 8. It uses paired and independent samples t-tests, and descriptive statistics.
  • Homework_8_Key.doc Writeup of answers for Homework 8.
  • homework8.sps SAS commands for homework 8.
  • heartrate_2005.xls This is the Excel file to use for Homework 8.
  • homework9_2005.doc This is SPSS homework 9. It involves reading in the Afifi raw data file using a data list command, creation of new variables, crosstabs, regression analysis and logistic regression.
  • Homework_9_Key.doc Writeup of answers for Homework 9.
  • homework9.sps SAS commands for homework 9.