Example SAS programs
SAS programs that have been discussed in lab (or in class) are included
here. You can copy a program to your PC or vincent account by selecting
SAVE AS from the FILE menu in your web browser.
You can copy the file to the SAS program editor window by
selecting Open from the SAS File menu, moving to the appropriate
directory, selecting the program, then clicking OK.
Programs discussed on 28 Aug 2007
Tomato.sas Data step with infile for
external data, plots, summary statistics, subsetting data, high
resolution plots <
Tomatocards.sasTomato.sas, but
using a cards; statement to include the data with the sas program
Program discussed on 4 Sept 2007
Sparrow.sas Two sample t-test,
Welch unequal variance t-test
Sparrow2.sas Residual
diagnostics for 2 sample t-test,
Wilcoxon rank sum test, Levene test, Randomization test.
tquant.sasCompute quantiles of t
distributions, given probability and d.f.
tprob.sasCompute probability of
observing < T from a t distribution with specified d.f. This
computes the inverse of tquant.sas
cquant.sasCompute quantiles of Chi-square
distributions, given probability and d.f.
cprob.sasCompute probability of
observing < C from a Chi-square distribution with specified d.f. This
computes the inverse of cquant.sas
Programs discussed on 11 Sept 2007
Sparrow2.sas Residual
diagnostics for 2 sample t-test,
Wilcoxon rank sum test, Levene test, Randomization test.
Transformations in a SAS data step
judges.sas 1-way ANOVA, estimates
and contrasts, multiple comparisons procedures.
Programs discussed on 18 Sept 2007
schiz.sas Paired t tests and ci's,
analysis of block designs
schiz2.sas Program to plot values
in blocks, plus sorting by block means.
Programs from lab on 9 Oct 2007
meat.sas Linear regression using proc glm
corr.sas Estimate and test correlations
boxcox.sas Data manipulation for
Box-Cox regression. Compute summary
statistics per group then log transform means and sd's.
Programs from lab on 16 Oct 2007
brain.sas Multiple regression in
proc reg and proc glm;
Programs from lab on 23 Oct 2007
brain2.sas Multicollinearity and
case diagnostics in proc reg
births2.sas Loess smoothing,
Box-Tidwell method, Breusch-Pagan test, and cutting X into groups.
births3.sas Durbin-Watson
statistic, fitting a regession with AR(1) error structure.
Programs from lab on 30 Oct 2007
fquant.sas Compute quantiles from F
distributions for specified probability, df numerator and df error.
Programs from lab on 6 Nov 2007
bear.sas Model selection (all
subsets, stepwise).
Programs from lab on 13 Nov 2007
ratweight.sas 2 way ANOVA, with
contrasts and estimates
ratweight2.sas 2 way ANOVA:
slicing and by-groups.
excel.sas Reading data files from Excel.
Programs from lab on 27 Nov 2007
wool.sas Estimation of variance components
wool2.sas Estimation of variance
components with 2 random components
splitteach.sas Split plot using
PROC MIXED
Programs not discussed in lab on 4 Dec 2007
smoking.sas Analysis of contingency
tables