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.
This page contains the SAS and SPSS handouts and homework assignments for Biostat 510 from winter semester, 2004.
SAS commands for handouts given in class can be accessed here.descriptives.sas These commands show how to read in an Excel file, how to set up missing values, and create a new variable, how to do simple descriptive statistics, frequencies, histograms, crosstabs and boxplots. ttest.sas These commands show how to read in a raw data file, set up missing values, create new values, and create formats for categorical variables. It also shows how to do one-sample, independent-sample and paired t-tests using SAS. Merging data sets based on the value of a key variable is also illustrated. freq.sas These commands show how to do oneway tabulations and cross-tabulations using SAS. It shows how to get chi-square tests for goodness of fit for a oneway table and chi-square tests of independence or homogeneity for cross-tabulations. The calculation of relative risks and odds ratios is also illustrated. matchfreq.sas These commands show how to carry out appropriate tests for matched frequency data using SAS, including McNemar's test of symmetry and Cohen's kappa for agreement between raters. simplereg.sas These commands show how to carry out a simple linear regression, get residuals, and check model assumptions using SAS. regress.sas These commands show how to carry out regression using dummy variables and how to get a multiple regression using SAS. interaction.sas These commands show how to carry out a polynomial regression with a single continuous predictor, how to carry out a regression with a single dummy variable and a continuous variable and an interaction between them (ANCOVA model), using SAS. variables and how to get a multiple regression
SPSS commands and output for examples given in class are included here.spss_ttest.doc These commands and output show how to read in raw data file, how to set up missing values, and create a new variables, how to do simple descriptive statistics, and paired and independent samples t-tests. spss_crosstabs.doc These commands show how to recode continuous variables into categories, how to set up value labels, and how to carry out contingency table analysis using SPSS. spss_regression.doc These commands show how to do correlations, simple linear regression, create dummy variables, and do multiple linear regression using SPSS. spss_anova_logistic.doc These commands show how to carry out a oneway and twoway anova using SPSS, and how to carry out a logistic regression using SPSS.
Homework assignments can be viewed/downloaded here.homework1_2004.doc This homework includes reading in an Excel File, setting up missing values in SAS, getting frequencies, descriptive statistics, and graphs. homework2_2004.doc This homework uses the permanent SAS data set, and asks to calculate one-sample, independent sample and paired t-tetsts. homework3_2004.doc This homework uses the permanent SAS data set from homework 2, and asks to oneway frequencies, chi-square goodness of fit tests for oneway frequencies, twoway contingency tables, chi-square tests, relative risks and odds ratios, and cross-tabulations of paired categorical variables and McNemar's test for paired data. homework4_2004.doc This homework requires that the raw data file brca.dat be read into SAS. To get this raw data file, you must first save data.exe to your desktop and then double-click on it to extract the data files that are in it. By default, these files will all be placed in c:\temp\labdata. If the files will not extract, it could be because they already exist. In that case, you don't need to extract them. Another option is to change the location of the folder where the files are placed. Please note the revised due date for this homework is Thursday, February 12, 2004. homework5_2004.doc This homework requires that the raw data file afifi.dat be read into SAS. To get this raw data file, you must first save data.exe to your desktop and then double-click on it to extract the data files that are in it. By default, these files will all be placed in c:\temp\labdata. If the files will not extract, it could be because they already exist. In that case, you don't need to extract them. Another option is to change the location of the folder where the files are placed. This homework is due on Thursday, February 19, 2004. homework6_2004.doc This homework again requires that the raw data file afifi.dat be read into SAS. See homework 5 above for instructions for how to get this data set. The homework asks you to do a linear regression with several dummy variables as predictors. It also asks you to run a multiple regression model with many predictors, and then to run several selection methods to choose among possible models. There are also some logistic regression problems for this homework, comparisons between proc freq and proc logistic output and selection methods for a logistic regression model. homework7_2004.doc This homework uses SPSS to get descriptive statistics and t-tests. It uses the Excel file hrtrate_2004.xls homework8_2004.doc This homework again requires that the raw data file afifi.dat be read into SPSS. See homework 5 above for instructions for how to get this data set. This homework is due on Thursday, April 8th. The answer key for this homework will be posted Friday morning, April 9th. Please don't be late with this homework. homework8key.doc This is the key for homework 8. Please note that I have not yet included the information for problem 9, which is the anova problem. I'll try to get it on my web page tomorrow morning. missing_values_in_SPSS.doc This note gives information on how to take care of missing values in SPSS.