SAS Programs

Printer-friendly versionPrinter-friendly version

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 function-plot.sas
 Basic Poisson Calculations in SAS
 2.3.1 PoissonCal.sas - PoissonCal.lst
Poisson sampling and goodness of fit with one-way table
 2.3.1 soccer.sas - 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

3.2.1

4.1.1

4.1.2

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
 5.4.1
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

 WaterStudyLogisticRegression.pdf

 WaterStudyModelSelection.pdf

Datafile: water_level.txt

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

Poisson Regression

Datafile: crab.txt

 9.2

Poisson Regression with rate

Datafile: creditcard.txt

 9.3
CASE STUDY: The Ice Cream Study at Penn State  
CASE STUDY: Stress and Smoking
Datafile: stress.txt
 

stress_smoking.sas - stress_smoking.lst
stress_smoking_1.sas - stress_smoking_1.lst
stress_smoking_loglin_WH.sas
stress_smoking_polyt_1resp_WH.sas
stress_smoking_polyt_2resp_WH.sas

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