Biostat 510 Class Handouts for winter 2008 can be found here:
Fast_Facts_for_SAS.doc This document gives a brief introduction to getting data into SAS using different methods, a few of the basic SAS syntax rules, and a list of statistical techniques and the appropriate SAS procedures for them.
Simple Descriptive Statistics Using SAS
sas_descriptives_lecture_2008.doc This document gives instructions on how to use SAS for simple descriptive statistics and graphs. descriptives_lecture.sas This SAS command file accompanies the handout on descriptive statistics. MARFLT.DAT This raw data file is the first data set used in the descriptive statistics handout. MARCH.XLS This Excel file is the second data set used in the descriptive statistics handout. business.sas7bdat This SAS data set data file is also used in the descriptive statistics handout.
Data Management Tasks Using SAS
sas_data_management_lecture_2008.doc This document gives instructions on how to use SAS for basic data management tasks. datamgt.sas This SAS command file accompanies the handout on data management using SAS. MARFLT.DAT This raw data file is the first data set used in the descriptive statistics handout. MARCH.XLS This Excel file is the second data set used in the descriptive statistics handout. business.sas7bdat This SAS data set data file is also used in the descriptive statistics handout.
How to use Permanent SAS data sets (.sd2 and .sas7bdat files)
sas_use_permanent_data_lecture_2008.doc This document gives instructions and examples on how to use SAS permanent data sets created in SAS release 6 or in SAS release 7 thru 9. useperm.sas This SAS command file goes along with the lecture on how to use a permanent SAS data set. sasdata1.zip This zipped file contains several SAS release 6 (.sd2) data sets to use in the demo of how to use a permanent SAS data set. sasdata2.zip This zipped file contains several SAS release 8/9 (.sas7bdat) data sets to use in the demo of how to use a permanent SAS data set.
How to carry out t-tests in SAS (independent sample t-tests, paired sample t-tests, and one-sample t-tests)
sas_ttest_lecture_2008.doc This document gives instructions and examples on how to use SAS permanent data sets created in SAS release 6 or in SAS release 7 thru 9. ttest.sas This command file goes along with the lectures notes for carrying out a t-test using SAS.
Combining SAS data sets
combining_sas_data_sets_lecture_2008.doc This document gives instructions on how to combine SAS data sets by adding cases (stacking) or adding variables (merging). It ilustrates one-to-one and one-to-many matching. combine.sas This SAS command file accompanies the handout on combineing SAS data sets.
Oneway frequency tabulations and twoay cross-tabulations using SAS
sas_frequencies_lecture_2008.doc This document illustrates how to use SAS to generate oneway and twoway tables for categorical variables. The creation and use of simple formats are also illustrated. frequencies_lecture1.sas This SAS command file accompanies the handout on oneway and twoway frequencies. WERNER2.DAT This raw data file contains information on patients who used birth control pills and matched patients who did not use birth control pills. cars.sas7bdat This permanent SAS data set contains information on Cars manufactured in the U.S.A., Japan, and Europe.
Matched Frequency Tables
sas_frequencies_lecture2_2008.doc This document illustrates how to use SAS to get McNemar's test and Cohen's Kappa for matched frequency data. frequencies_lecture2.sas This SAS command file accompanies the handout on matched frequency analysis. afifi_setup.sas This SAS command file sets up the Afifi permanent SAS data set and the formats that are used with the data set. AFIFI.DAT This raw data file contains information on patients who came in to the Los Angeles Hospital Emergency Department. Measurements were made on the patients at two time points: First, when they came into the E. D. and then the last measurement made prior to discharge or death.
Simple Linear Regression Using SAS
simple_linear_regression_lecture_2008.doc This document illustrates how to use SAS to fit a simple linear regression model, and carry out fit diagnostics, using plots. SAS ODS output for regression analysis is also illustrated. regression1.sas This SAS command file goes along with the handout on simple linear regression. cars.sas7bdat This permanent SAS data set contains information on Cars manufactured in the U.S.A., Japan, and Europe, and is used for the example on simple linear regression.
Using Dummy Variables in Regression models in SAS, and Oneway ANOVA.
dummy_var_regression_lecture_2008.doc This document illustrates how to use SAS to create dummy variables and fit a regression model using dummy variables. It also illustrates how to carry out a simple oneway ANOVA model. dummy_variables.sas This SAS command file goes along with the handout on dummy variables in regression. cars.sas7bdat This permanent SAS data set contains information on Cars manufactured in the U.S.A., Japan, and Europe, and is used for the example on dummy variables in regression.
ANCOVA models using Proc Reg and Proc GLM in SAS.
sas_ANCOVA_2008.doc This document illustrates how to use SAS to create dummy variables and interactions and fit an ANCOVA model using Proc Reg and Proc GLM. ancova.sas This SAS command file goes along with the handout on fitting ANCOVA models using SAS. htwt.por This SPSS portable file contains information on height and weight for 237 males and females. It can be imported into SAS using Proc Convert.
ANCOVA models for three or more groups using Proc Reg and Proc GLM in SAS. We illustrate creating the dummy variables and interactions for a three-group ANCOVA model. These methods can be easily extended to ANCOVA models with more than three groups.sas_ANCOVA_with_three_groups_2008.doc This document illustrates how to use SAS to create dummy variables and interactions and fit an ANCOVA model for three groups using Proc Reg and Proc GLM. ancova_three_groups.sas This SAS command file goes along with the handout on fitting ANCOVA models with three groups using SAS. cars.sas7bdat This SAS dataset contains data on 486 cars that can be used in the SAS ANCOVA for three groups. formats.sas7bcat This SAS formats catalog should be downloaded so it can be used with the cars2 dataset.
Multiple regression models and collinearity using SAS.
sas_multiple_regression_lecture_2008.doc This document illustrates how to use SAS to fit a multiple regression model, check influence diagnostics and check for collinearity. multiple_regression.sas This SAS command file goes along with the handout on fitting multiple regression models using SAS. WERNER2.DAT This ascii file contains the raw data to be used to create the werner dataset that is used in the multiple regression example. baseball.sas7bdat This SAS dataset is used for the example on fitting multiple regression models using SAS.
Logistic regression models using SAS.
logistic_regression_2008.doc This document illustrates how to use SAS to fit a logistic regression model for a single binary predictor, a continuous predictor, and for categorical predictors using Proc Logistic and Proc Genmod. logistic.sas This SAS command file goes along with the handout on fitting logistic regression models using SAS. brca.dat This ascii file contains the raw data to be used to create the breast cancer dataset that is used in the logistic regression example.
Logistic regression model with ODS graphics using SAS.
logistic_with_ODS_graphics.doc This document illustrates how to use SAS to fit a logistic regression model for a single continuous predictor, and get diagnostic plots, plus a plot of the predicted probability vs. the values of the predictor. logistic_ods_graphics.sas This SAS command file goes along with the handout on fitting logistic regression with ODS graphics using SAS. brca.dat This ascii file contains the raw data to be used to create the breast cancer dataset that is used in the logistic regression with ODS graphics example.
Writing out data using SAS.
Writing out Data Using SAS.doc This document illustrates several ways to write out raw data using SAS, including tab-delimited, comma-delimited, column-specific data, and Excel files. writedata.sas This SAS command file contains the commands used in the handout on writing data using SAS. iris.sas7bdat This SAS dataset is used for the example on writing out data using SAS.
Descriptive Statistics and t-tests using SPSS
spss_descriptives_ttest.doc This document illustrates how to use SPSS to read in raw data, and to create simple plots, and carry out independent samples t-tests and paired samples t-tests. descriptives_ttest.sps This SPSS command file goes along with the handout on descriptive statistics and t-tests using SPSS. WERNER2.DAT This ascii file contains the raw data to be used to create the Werner dataset that is used in the SPSS descriptives and t-test example.
Handling missing values in SPSS
missing_values_in_SPSS.doc This document describes how SPSS handles missing values when recoding or creating new variables.
Oneway frequencies and cross-tabulations using using SPSS
spss_frequencies_lecture_2008.doc This document illustrates how to use SPSS to recode continuous variables into categories, how to get simple oneway frequencies, chi-square goodness of fit test, binomial test, two-way cross-tabulations with chi-square tests of independence. crosstabs.sps This SPSS command file goes along with the handout on frequencies and cross-tabulations using SPSS. werner.sav This SPSS dataset contains the data used in the example on SPSS frequencies and crosstabs.
Simple Regression, Dummy Variables in Regression, Oneway ANOVA, and Quadratic Regression using SPSS
spss_simple_reg_2008.doc This document illustrates how to use SPSS to get scatterplots and correlations and fit a linear regression model with one continuous predictor. It also illustrates how to fit a linear regression model using dummy variables for a categorical variable, and how to fit the comparable model using Oneway ANOVA. A polynomial (quadratic) regression model is also illustrated. simple_reg.sps This SPSS command file goes along with the handout on simple regression using SPSS. werner.sav This SPSS dataset contains the data used in the example on SPSS simple regression.
ANCOVA Models using SPSS
spss_ancova.doc This document illustrates how to use SPSS to get scatterplots with separate regression lines for different groups, and how to fit ANCOVA models using dummy variables in a regression setting, or using the general linear model module in SPSS. ancova.sps This SPSS command file goes along with the handout on fitting ANCOVA models using SPSS. htwt.por This SPSS portable file contains the data used in the first example on SPSS ANCOVA. cars.sav This SPSS dataset contains the data used in the second example on SPSS ANCOVA.
Multiple Regression Models and Collinearity Diagnostics using SPSS
spss_multiple_regression_lecture_2008.doc This document illustrates how to use SPSS to get correlation matrices and scatterplot matrices, how to fit multiple linear regression models, and check collinearity diagnostics using SPSS. multiple_reg.sps This SPSS command file goes along with the handout on fitting ANCOVA models using SPSS. werner.sav This SPSS dataset contains the data used in the first example on multiple regression using SPSS. baseball.sas7bdat This SAS dataset contains the data used in the second example on fitting multiple regression models using SPSS.
Fitting Logistic Regression Models using SPSS
spss_logistic_regression_2008.doc This document illustrates how to use SPSS to fit logistic regression models, using several examples with dummy variables, categorical variables, and continuous variables as predictors. It also shows how to read in raw data with a data list command, create new variables, and calculate and format dates. logistic.sps This SPSS command file goes along with the handout on fitting logistic regression models using SPSS. brca.dat This raw data file contains the data used in the SPSS logistic regression example.