Biostatistics 510: Statistical Computing Packages Winter 2007
2007 Syllabus:Click here to get the syllabus for Biostat 510 for Winter 2007.
Final Project:Click here to get the Final Project assignment and the data sets for students for Biostat 510 for Winter 2007.
Data sets and commands can be found here:intro_data.zip Save this archive containing data sets on the desktop. Double-click to open it. Drag files out as you need them. intro_commands.zip Save this archive containing SAS commands on the desktop. Double-click to open it. Drag files out as you need them. sasdata1.zip SAS version 6 data sets (.sd2) sasdata2.zip SAS version 8/9 data sets (.sas7bdat and .sd7)
General Handouts can be found here:save_sasgraphs.doc This document gives instructions on how to save/export a graph from SAS/GRAPH or SAS/INSIGHT into a Microsoft Word document or to Power Point. Preparing Data Using Excel This web page from CSCAR gives an explanation of how to set up an Excel file for use with a statistical package, such as SAS or SPSS. fonts.sas This little SAS command file contains a line of code that will make your SAS output look good when printed from any computer (it will get rid of the funky-looking little row, such as fffff for a line in the output for tables, etc.) whether you have SAS installed on that computer or not. Submit this line of code at the beginning of your SAS session whenever you run SAS. SAS_Functions.doc This document gives a listing of SAS functions from SAS release 8.2.
Handouts discussed in class, along with SAS commands that accompany them can be found here:
Simple descriptive statistics using SAS:
sas_descriptives.doc How to get simple descriptive statistics using SAS. OWEN.XLS This is the SAS data set that is used in the descriptive statistics example. descriptives.sas SAS commands that demonstrate how to carry out simple descriptive statistics.
t-tests using SAS:
sas_ttest.doc How to get One-Sample, Paired, and Independent Samples t-tests using SAS. ttest.sas SAS commands for t-tests.
Simple Linear Regression using SAS:
sas_simple_regression.doc How to create a bivariate scatter plot with a linear regression line, carry out a Pearson correlation, and fit a simple linear regression model using SAS. There are also examples of checking residuals for normality and for equality of variance. simple_regression.sas SAS commands for simple linear regression.
Dummy Variable Predictors in Linear Regression Using SAS:
dum_var_regression.doc How to create dummy variables and fit linear regression model using dummy variables as predictors using SAS. There are also examples of checking residuals for normality and for equality of variance, in a model with dummy variables as predictors. dum_var_regression.sas SAS commands for dummy variables in a linear regression model.
Polynomial Regression Using SAS:
sas_polynomial_regression.doc How to carry out a quadratic regression model using SAS. polynomial_regression.sas SAS commands for a quadratic regression.
Transformations of the Dependent Variable Using SAS:
sas_transformations.doc An introduction to transformations of the dependent variable in a linear regression model using SAS. transformation.sas SAS commands for transforming the dependent variable in a linear regression model. QQplots.pdf An illustration of different types of distributions and how they look in histograms and QQplots.
Multiple Linear Regression Using SAS:
sas_multiple_regression.doc How to use SAS to get a correlation matrix, fit a multiple linear regression model, and check for collinearity. multiple_regression.sas SAS commands for multiple regression.
Principal Components Analysis (PCA) to Reduce Dimensionality Using SAS:
sas_principal_components.doc How to use SAS to get a principal components analysis, and save the principal components to a new data set, and use the first principal component as a predictor in a regression model. principal_components.sas SAS commands for principal components analysis.
Analysis of Covariance (ANCOVA) Using SAS:
sas_ANCOVA.doc How to use SAS to create scatterplots with regression lines for subgroups on the same graph. How to fit an ANCOVA model, and check for interactions. ancova.sas SAS commands for analysis of covariance.
Regression Model Selection Methods Using SAS:
sas_regression_selection.doc How to use stepwise and backward selection methods for linear regression models in SAS, plus how to get all possible regressions, selection based on adjusted R-Square, and selection based on Mallow's CP statistic. regression_select.sas SAS commands for regression model selection methods.
Oneway Frequencies and Cross-tabulations Using SAS:
freq_stats.ppt Power Point Handout on Stratified Analyses, Matching, and Agreement Statistics (Carla Talarico). sas_frequencies.doc How to set up user-defined formats for categorical variables in SAS, so the output will look nice. How to recode variables into categories. How to get oneway frequency tables, goodness of fit tests, and binomial tests for categorical variables. How to get cross-tabulations with various tests and measures of association. frequencies.sas SAS commands that go with the handout on frequency tabulations and cross-tabs.
Analysis of Frequencies for Matched Data Using SAS:
sas_matched_freq.doc How to get McNemar's test of symmetry for matched data, and get agreement statistics (Cohen's kappa and weighted kappa) for matched data. matchfreq.sas SAS commands that go with the handout on analysis of matched frequency data.
Logistic Regression Using SAS:
LogisticRegression.ppt Power Point handout on Introduction to Logistic Regression (Vanessa Perez) vanessa_3-20-07_LogisticRegression_SAS_handout.doc Microsoft Word document with sample commands and output for logistic regression using SAS. vanessa_3-20-07_BreastCancer.sas SAS commands to run the logistic regression analysis illustrated in the handout above, using the Breast Cancer data. logistic_with_ods_graphics.doc Handout showing how to get various diagnostic plots and a plot of estimated probability of an event vs. a continuous predictor. logistic_ods.sas SAS commands for diagnostic plots and a plot of estimated probability of an event vs. a continuous predictor, using the experimental ODS graphics system.
Working with Missing Values in SPSS:
missing_values_in_SPSS.doc This handout discusses the difference between user-defined missing and system-missing values in SPSS, and shows how to work with missing values when recoding variables.
Descriptive Statistics and t-tests Using SPSS:
spss_ttest.doc This handout shows how to read in raw data using SPSS, get simple descriptive statistics, histograms, and independent and paired samples t-tests. descriptives_ttest.sps SPSS commands that go with the handout on descriptive statistics and t-test.
Simple Regression and Dummy Variable Regression Using SPSS:
spss_simple_reg.doc This handout shows how to carry out a simple linear and get diagnostic plots using SPSS. It also illustrates how to create dummy variables in SPSS, and use them in a linear regression model. simple_regression.sps SPSS commands that go with the handout on simple linear regression.
Multiple Regression Using SPSS:
spss_multiple_regression.doc This handout shows how to fit a linear regression model with multiple predictors and get diagnostic plots using SPSS. multiple_reg.sps SPSS commands that go with the handout on multiple linear regression.
ANCOVA Using SPSS:
spss_ancova.doc This handout shows how to fit an Analysis of Covariance (ANCOVA) model using SPSS. Centering of the continuous predictor variable is also discussed. ancova.sps SPSS commands that go with the handout on ANCOVA.
Cross-tabulations Using SPSS:
spss_frequencies.doc This handout shows how to do simple cross-tabulations in SPSS, calculate odds ratios, calculate Mantel-Haenszel statistics across strata, and obtain measures of association for ordinal categorical variables. frequencies.sps SPSS commands that go with the handout on frequencies and cross-tabs.
Logistic Regression Using SPSS:
spss_logistic_regression.doc This handout shows how to fit a logistic regression model using SPSS, using a single binary (dummy variable) predictor and compares this output to a cross-tab; a single continuous predictor; a categorical predictor; and a number of predictors of different types. logistic_regression.sps SPSS commands that go with the handout on logistic regression. brca.dat Data set that is used for the handout on logistic regression with SPSS.
Biostat 510 Homework assignments can be found here:
Homework 1:
homework1.doc This homework is due Thursday, January 11th, 2007. group1.xls Excel data sheet for Group 1 for homework 1. GROUP2.xls Excel data sheet for Group 2 for homework 1. group3.xls Excel data sheet for Group 3 for homework 1. group4.xls Excel data sheet for Group 4 for homework 1. Group5.xls Excel data sheet for Group 5 for homework 1. GROUP6.xls Excel data sheet for Group 6 for homework 1. GROUP7.xls Excel data sheet for Group 7 for homework 1. group8.xls Excel data sheet for Group 8 for homework 1.
Homework 2:
homework2_2007.doc This homework is due Thursday, January 18th, 2007. Group1A.xls Excel data sheet for Group 1 for homework 2. Group2A.xls Excel data sheet for Group 2 for homework 2. Group3a.xls Excel data sheet for Group 3 for homework 2. group4a.xls Excel data sheet for Group 4 for homework 2. Group5a.xls Excel data sheet for Group 5 for homework 2. GROUP6A.xls Excel data sheet for Group 6 for homework 2. GROUP7A.xls Excel data sheet for Group 7 for homework 2. group8a.xls Excel data sheet for Group 8 for homework 2.
Homework 3:
homework3_2007.doc This homework is due Thursday, January 25th, 2007.
Homework 4:
homework4_2007.doc This homework is due Tuesday, February 6th, 2007.
Homework 5:
homework5_2007.doc Note: The due date for this homework has been changed to Tuesday, February 20th, 2007. afifi.dat This data set is to use with homework 5.
Homework 6:
homework6_2007.doc Note: The due date for this homework is Thursday, March, 8th, 2007. allgroups_merged.sas7bdat This SAS data set can be downloaded to use for homework 6 (be sure you download it, or save it to your disk, and don't try to open it directly from a net browser window--it will not work properly unless downloaded), or you can use the data set that you created in homework 3. Remember, you will need to use a libname statement whichever way you choose to go with the data set for this homework.
Homework 7:
homework7_2007.doc Note: The due date for this homework is Tuesday, March, 20th, 2007. afifi.sas7bdat This SAS data set can be downloaded to use for homework 7 (be sure you download it, or save it to your disk, and don't try to open it directly from a net browser window--it will not work properly unless downloaded), or you can use the data set that you created in homework 5. Remember, you will need to use a libname statement whichever way you choose to go with the data set for this homework.
Homework 8:
homework8_2007.doc Note: The due date for this homework has been changed to Tuesday, April 3rd, 20th, 2007. afifi.sas7bdat This SAS data set can be downloaded to use for homework 8 (be sure you download it, or save it to your disk, and don't try to open it directly from a net browser window--it will not work properly unless downloaded), or you can use the data set that you created in homework 5. Remember, you will need to use a libname statement whichever way you choose to go with the data set for this homework.
Homework 9:
homework9_2007.doc The due date for this homework is Tuesday, April, 10, 2007. afifi.dat This is a raw data file that can be downloaded to use for homework 9. You will need to write a data list command in SPSS to read in this raw data. Be sure you include your SPSS commands to read in the raw data in your homework. Also, please be sure to read in all variables, not just the ones illustrated in the homework document.