Biostat 510: Information from Winter 2006
General Handouts:Click here to see instructions on how to save/export a graph from SAS/GRAPH or SAS/INSIGHT. missing_values_in_SPSS.doc: information on how to work with missing values in SPSS.
Autism Data Set: (Used for extra credit problem).autism_demog.sas7bdat SAS data set containing the demographic information for 213 autistic children whose social skills were assessed at several time points. autism_socialization.sas7bdat SAS data set containing the socialization scores (VSAE and VSST) for the ages (cohorts) of 2, 3, 5, 9, 13, and 14 years. Autism Study.doc: a brief description of the Autism data set.
You can download class handouts and related materials here:
Descriptive Statistics in SASdescriptives.doc This handout shows how to import an Excel file and create a temporary SAS data set, set up missing values in a SAS data set, and calculating simple simple descriptive statistics. OWEN.XLS This is the Excel file that is used for the descriptive statistics example above. 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.
t-tests in SASttest.doc This handout shows how to create a permanent SAS data set from an Excel file, and how to carry out independent and paired samples t-tests, and a one-sample t-test.
Simple Linear Regression in SASsimple_regression.doc This handout shows how to carry out a simple regression using SAS, and get some diagnostic plots. WERNER2.DAT This data set can be used for the simple regression problem, illustrated in the handout above. simple_regression.sas These SAS commands are used to carry out the simple regression example.
Dummy Variable Regression in SASdum_var_regression.doc This handout shows how to carry out a dummy variable regression using SAS, how to do a polynomial regression, and how to do Box-Cox transformations. dum_var_regression.sas These are the SAS commands that go along with the handout on dummy variable regression above.
Multiple Regression and Collinearity Diagnostics in SASMultiple_Regression_and_Collinearity.doc This handout shows how to carry out multiple regression analysis in SAS, and check collinearity diagnostics. There is also an example of using the ODS system in SAS to capture output in a data set. multiple_regression.sas These are the SAS commands that go along with the handout on multiple regression and collinearity above.
ANCOVA in SASrevised_ANCOVA_Examples_Using_SAS.doc *REVISED* This handout shows how to carry out an analysis of covariance (ANCOVA) using SAS, using two examples. The cars example has been revised. revised_ancova_example.sas These are the (revised) SAS commands that go along with the handout on analysis of covariance above.
Regression Selection Methods in SASregression_selection.doc This handout shows how to select models in SAS using Stepwise selection, Backward selection, All Possible Regressions, Adjusted R-square, and Mallow's CP. regression_selection.sas These are the SAS commands that go along with the handout on analysis of covariance above.
SPSS Demo in Computer LabDemo1.SPS SPSS commands that were demonstrated in Computer lab SPSS orientation session.
Descriptives and t-tests in SPSSspss_ttest.doc This handout shows how to create an SPSS data set from a raw data file, how to create new variables, and how to carry out independent samples, paired samples, and one-sample t-tests. descriptives_ttest.sps SPSS syntax that goes with the handout above.
Simple Regression and Dummy Variable Regression in SPSSsimple_reg_SPSS.doc This handout shows how to carry out a simple regression using SPSS, how to create dummy variables, and how to carry out a dummy variables regression using SPSS. simple_regression.sps SPSS syntax that goes with the handout above.
Multiple Regression with Collinearity Diagnostics and Regression Selection Methods in SPSSMultiple_Regression_SPSS.doc This handout shows how to carry out multiple regression analysis in SPSS, and check collinearity diagnostics. Stepwise and backward selection methods are also illustrated, along with entering vairables in a regression model in blocks. multiple_reg.sps These are the SPSS commands that go along with the handout on multiple regression with collinearity diagnostics above.
ANCOVA in SPSSANCOVA_Examples_Using_SPSS.doc This handout shows how to carry out an analysis of covariance (ANCOVA) using SPSS using the htwt data set. ancova.sps These are the SPSS commands that go along with the handout on analysis of covariance above.
Frequency Tabulations and Contingency Tables in SASrevised_frequencies.doc This (revised) handout shows how to get one-way frequencies for categorical variables, and cross-tabulations (contingency tables) using SAS. Odds ratios and relative risks are calculated for 2x2 tables, and measures of association are illustrated for ordinal variables. The Mantel-Haenszel method for combining information across levels of a stratifying variable is also illustrated. revised_frequencies.sas This SAS command file contains commands for the frequency tabulations in the handout above. WERNER2.DAT This data set can be used for the frequency tabulations illustrated in the handout above.
Comparison of Proportions and Agreement for Matched Categorical Data in SASmatched_freq.doc This handout shows how to match observations from a data set to add new variables, and then how to do McNemar's test for matched proportions, using Proc Freq. Cohen's kappa and weighted kappa are also illustrated. matchfreq.sas This SAS command file contains commands for the matched frequency tabulations in the handout above. werner.sas7bdat This permanent SAS data set can be used for the analyses illustrated in the handout above.
Frequency Tabulations and Contingency Tables in SPSSfrequencies_SPSS.doc This handout shows how to recode variables to create categorical variables from continuous variables, get one-way frequencies for categorical variables, and cross-tabulations (contingency tables) using SPSS. Odds ratios and relative risks are calculated for 2x2 tables, and measures of association are illustrated for ordinal variables. The Mantel-Haenszel method for combining information across levels of a stratifying variable for 2x2 tables is also illustrated. frequencies.sps This SPSS command file contains commands for the frequency tabulations in the handout above. werner.sav This data set can be used for the frequency tabulations illustrated in the handout above.
Logistic Regression in SASlogistic_2006.doc This handout shows how to carry out logistic regression for a single continuous predictor, for categorical predictors, and for a mix of variable types. Logistic regression is illustrated using Proc Logistic, and Proc Gemod. logistic.sas This SAS command file contains commands for the logistic regressions in the handout above. brca.dat This data set can be used for the logistic regression analyses illustrated in the handout above. logistic_with_ods_graphics.doc This handout illustrates how to get SAS output into an rtf (rich text format) file, and generate a plot of the predicted values versus the values of a continuous predictor (AGE).
Logistic Regression in SPSSlogistic_regression_SPSS.doc This handout shows how to carry out logistic regression for a single continuous predictor, for categorical predictors, and for a mix of variable types using SPSS. logistic_regression.sps This SPSS syntax file contains commands for the logistic regressions in the handout above. brca.dat This data set can be used for the logistic regression analyses illustrated in the handout above.
Homework assignments can be downloaded here:
Homework 1homework1.doc For this homework, we read in 8 Excel files and combine them vertically into one data set. We set up missing value codes, and carry out some simple descriptive statistics and create basic graphs. Import_excel_hw1.ppt Power Point presentation on how to import an Excel file into SAS and save the syntax in a SAS command file. group1.xls Data from the first day of class for group 1. group2.xls Data from the first day of class for group 2. group3.xls Data from the first day of class for group 3. group4.xls Data from the first day of class for group 4. group5.xls Data from the first day of class for group 5. group6.xls Data from the first day of class for group 6. group7.xls Data from the first day of class for group 7. group8.xls Data from the first day of class for group 8.
Homework 2homework2_2006.doc REVISED! This is the corrected version of homework 2. Please use this revised version, not the one handed out in class.
For this homework, we read first create a permanent SAS data set, and then we carry out independent samples t-tests, paired t-tests and one-sample t-tests using the data from class.
Homework 3homework3_Jan27_2006.doc This is the corrected version of homework 3. You should work on problems 1 through 7, and answer questions a) through f) in problem 10. You do not need to download this version, if you already have a copy. afifi.dat The Afifi data set is to be used to carry out homework 3.
For this homework, we read first create a permanent SAS data set by reading in raw data. Note that there are 2 lines of data in the raw data file for each patient. We carry out a simple linear regression, and regressions using dummy variables, and check the residuals for the regressions.
Homework 4homework4_2006.doc This homework problem asks you to create a Pearson correlation matrix, carry out multiple linear regression problems, and check collinearity diagnostics. You should use the permanent SAS data set (b510.afifi) that you created for homework 3 to do this assignment.
Homework 5homework5_2006.doc This homework problem asks you to create run an ANCOVA model with interactions, for the exercise data that we created on the first day of class and to run run some regression selection methods on the Afifi data set.
Homework 6homework6_2006.doc This homework problem asks you to create an SPSS data set from the 8 Excel files that were created in the first day of class, create new variables, and carry out some simple descriptive statistics, independent samples t-tests, paired t-tests, and one-sample t-tests.
Homework 7homework7_2006.doc In this homework problem you are asked to read in raw data from the afifi.dat raw data file, do some recodes, and carry out some regression problems. afifi.dat The Afifi data set is to be used to carry out homework 7.
Homework 8homework8_2006.doc In this homework problem you are asked to read in a permanent SAS data set and an SPSS data set, and get oneway frequencies and cross-tabulations using both programs. afifi.sas7bdat The Afifi permanent SAS data set is to be used to carry out homework 8. afifi.sav The Afifi SPSS data set is to be used to carry out homework 8. Homework 8 Key. The key for homework 8.
Homework 9homework9_2006.doc In this homework problem you are asked to read in a permanent SAS data set and an SPSS data set, and carry out logistic regression analyses. logistic_regression_graph.doc In this homework problem you are asked to read in a permanent SAS data set and an SPSS data set, and carry out logistic regression analyses. afifi.sas7bdat The Afifi permanent SAS data set is to be used to carry out homework 9. afifi.sav The Afifi SPSS data set is to be used to carry out homework 9. Homework_9_Key.doc The key for homework 9.