SAS Programs

Some Helpful Resources:

The Topic / Procedure Page
SAS code - text file
Using chisq.test, creates a table of one-way frequencies for observations of a die and then finds calculates a one-way chi-square test 2.5
Goodness-of-Fit Test: Cell Probabilities Functions of Unknown Parameters 2.7
Binomial Likelihood   log-likelihood
Basic Poisson Calculations in SAS 2.3.1 - PoissonCal.lst
Poisson sampling and goodness of fit with one-way table 2.3.1 - soccer.lst
Binomial test of proportions 2.3.2
Some simple binomial calculations 2.3.2 SimpleBinomialCal.R
Goodness of fit with X2 with G2 2.5
Two-way tables: Measures of associations and effect sizes 3.1.5
Test of Independence
Choice of scores - midranks




Test of independence, and measures of associations for an IxJ table 3.2.3
Enters tea tasting data and performs one-sided and two-side Fisher's exact test for count data. 3.3
McNemar's Test 4.2.3
Cohen's Kappa - Measure of Agreement 4.2.5
Marginal Odds Ratio 5.3
3 × 2 × 2 Table
Two Variables Independent of a Third
Conditional Independence
6 × 2 × 2 Table: Tests of indepndence and associations 5.4.6
Logistic Regression 6.2.1
Logistic Regression 6.3.1
Logistic Regression with continuous covariates 7.1.1

CASE STUDY: The Water Level Study
Logistic Regression Analyses

Water Level Study 2 (.doc)
Model Selection: Backward & Stepwise Procedures



Datafile: water_level.txt

Diagnostics for binary logistic regression 7.2.1 - assay.lst - assay1.lst - assay4.lst
Baseline-category logit model 8.2.1 - alligator.lst
Proportional-odds cumulative logit model 8.4.1 - cheese.lst
Proportional-odds cumulative logit model 8.4.2 - abortion.lst

Poisson Regression

Datafile: crab.txt


Poisson Regression with rate

Datafile: creditcard.txt

CASE STUDY: The Ice Cream Study at Penn State  
CASE STUDY: Stress and Smoking
Datafile: stress.txt - stress_smoking.lst - stress_smoking_1.lst

Loglinear model: 2 × 2 table 10.1.2 - VitaminCLoglin.lst
Loglinear model of independence for two-way table 10.1.3 - vote.lst
Loglinear models k-way table 10.2 - berkeleyLoglin.lst
Loglinear model: model selection and measures of fit 10.2.9 - collar.lst - collarDIndex.lst
Sparse data: sampling and structural zeros 11.1.1 - ZerosEx.lst
Sparse data: Incomplete table analysis 11.1.3 - health.lst - health1.lst - health3d.lst - health13d.lst
Ordinal data: Linear by linear association model 11.2.1 HeartDiseaseLoglin.lst
Dependent data: loglinear models 11.3.2 - movies.lst
Dependent data: quasi-independence loglinear model 11.3.5 - monkey.lst
Datafile: schiz.dat 12.2

Please Note: For output, we have listed only the .lst files here. You can also get more highly formatted HTML output from SAS which incorporates graphs, if requested. In SAS, follow the menu options 'Tools' > 'Options' > 'Preferences' and under the 'Results' tab check the box for either Listing or HTML output.