Psych 3030 Home Page ||
Course Outline ||
NWK files ||
SAS Help ||
Program Directory Tree ||
What's New? (programs)
With the change to the new Psych Web Server, some
program links below may no longer work. Please let me know.
The programs listed below are all stored on the Hebb/YorkArts server and on Phoenix. The programs are also linked to the Web, so selecting the highlighted name should display the code in your browser.
If you are also running a SAS session, you can cut/paste the code into the SAS Program Editor window [1].
In the Hebb Lab, they may be also be used as follows:
From the Display Manager window in SAS, choose File -> Open into Pgm Editor, then navigate to the directory,
n:\psy3030\examples
(Sasuser on Lancelot\Home01)
The files are organized here in subdirectories, corresponding to the topic areas listed below. Double-click on the name of the file you want, then press F3 to submit the program to SAS.
[1] Note:
External users should be aware that the programs assume that data files are stored in directories DATA and NWK defined by SAS filename statements,
and that all macro programs are stored in an autocall library. The filename statements used in the PsychLab are contained in this
autoexec.sas file.
Students wishing to obtain the entire collection of SAS programs and
data sets for Psych3030 can download PSY3030.ZIP (883K). A .INSTALL file describes how to install these files for use with
SAS.
Phoenix
On Phoenix, the files are stored in under the directories:
/courses/as/psyc/macros
/courses/as/psyc3030
Jump to:
[
Program Directory Tree ||
Intro to SAS ||
Regression analysis ||
ANOVA ||
SAS macro programs ||
Data sets ||
Anova Project
]
- example1.sas

- A sample SAS program, to illustrate a DATA step and PROC steps.
Sample programs listed here illustrate various techniques for EDA and resistant lines (marked [R]), simple linear regression ([S]), and multiple regression ([M]).
The
icon is linked to Web-enhanced SAS output
from the program.
- collin.sas

- [M] Collinearity in regression.
Two examples: one of
uncorrelated predictors, the other of highly correlated ones, and the associated statistics for detecting collinearity problems in regression.
- deathcox.sas

- [M] Box-Cox analysis of Deaths data.
Illustrates the use of the Box-Cox method to choose a transformation of the response variable, with graphic plots of RMSE, and t-value for each predictor vs. lambda (power), and an influence plot for the observations.
- diamond.sas

- [S] Pricing of Diamond rings. Fits three models, and compares predicted
values graphically.
- fitinfl.sas

- [M] Influence analysis and plot for fitness data.
- lackofit.sas

- [S] Lack of Fit test for linear regression.
Illustrates finding the SS(Pure Error) and conducting the lack of fit test with PROC RSREG.
- normplt1.sas

- [S] Normal probability plot of residuals.
Shows 4 different ways to get a normal probability plot of residuals in SAS.
- normplt2.sas

- [S] Normal probability plot of residuals.
Regression of crime rate on personal income in the SMSA data, showing the use of the NORMPLOT macro to get a normal QQ plot of residuals.
- normplt3.sas

- [S] Normal probability plot of residuals.
Regression of IMR on INCOME from the Nations data, showing the use of the
new GRAPHICS option in PROC REG, and the NQPLOT macro to get a normal QQ plot of residuals.
- nqpdemo.sas

- [S] Normal Quantile plot for various distributions. Generates data from 4 different distributions and compares their normal probabilty plots.
- nwkt0503.sas

- [S] Weighted Least Squares Example (NWK Table 5.3). Compares weighted and unweighted least squares in a case where error variance is proportional to X.
- nwk10t01.sas

- [S] Weighted Least Squares Example (NWK Table 10.1). Compares weighted and unweighted least squares in a case where error variance is proportional to X^2.
- nwkt0904.sas

- [M] Life Insurance Example (NWK Table 9.4).
A response surface model predicting amount of life insurance carried from annual income and a measure of risk aversion.
- nwk08t01.sas

- [M] Selecting the best predictors (NWK Table 8.1). Predicting survivial time following a particular type of liver surgery from various indicators, using RSQUARE and STEPWISE analysis.
- nwk11t01.sas

- [M] Insurance innovation study (NWK Table 11.1).
Dummy variables to allow for differences in intercept and slope.
- piecewrk.sas

- [M] Piecework Operation (NWK Problem 9.7).
A polynomial model predicting productivity from age of employees.
- resimr.sas

- [R] Resistant line for IMR data.
Fits a resistant line predicting infant mortality rate from per capita income, and compares this with a log-log fit.
- resimrb.sas

- [R] Boxplot of data and residuals for IMR data. Continuation of RESIMR, comparing the distribution of log(IMR) with that of the residuals from the log-log fit.
- resline2.sas

- [R] Fit Resistant line to XY data.
Rates of divorce from 1870 to 1960.
- resline3.sas

- [R] Fit Resistant line to XY data.
Mortality due to breast cancer in relation to mean annual temperature in European countries.
- sampdist.sas

- [S] Generate sampling distribution of B0, B1.
Generates 100 samples of X-Y data to illustrate the sampling distribution of slope and intercept in regression.
- spines.sas

- [R] Resistant line for Spines data.
Relation between age (X) and a measure of body size.
- therapy.sas

- [S] Simple regression example: Personality Test vs. Therapy
- therapy2.sas

- [S] Simple regression example: Inference
- therapy3.sas

- [M] Multiple regression example
- therapy4.sas

- [M] Multiple Regression with Dummy Variables and Interaction
- therapy5.sas

- [G] Some graphics for the therapy data
- tiretest.sas

- [M] Tire testing (NWK 10.15). Dummy variables and interaction to test equality of intercepts and slopes.
- uspop.sas

- [S] Growth of US Population, 1790-. Fits a quadratic model and compares that with a model of exponential growth.
These program illustrate various methods for analysis of One-way ANOVA designs (marked [1]), Two-way designs ([2]), and Three-way and more complex designs ([3]).
- anxiety.sas

- [3] Three-way anova: Instructions x Gender x Test, from summary statistics.
- barttest.sas

- [1] Demo of Bartlet's test for homogeneity of variances
- bonmult.sas

- [1] Creates a graph which compares the efficiency of the Bonferroni
and Scheffe tests
- fpower1.sas

- Power computations for F test in Balanced Designs.
Illustration of use of the FPOWER macro.
- imrsprd.sas

- [1] Spread Level plot for Nations data.
Illustrates the construction of the spread-level plot to find a transformation to equalize variances in one-way data.
- infantm.sas

- [1] Infant Mortality Rates. Illustrates finding a power transformation to equalize variabilty.
- learning.sas

- [1] Foreign language learning: One Way ANOVA.
Vocabulary score for 3 methods of teaching foreign language, with contrasts for two comparisons of interest.
- multcomp.sas

- [1] Multiple contrast methods.
Compare means in the SUCROSE data with various multiple comparison methods (Bonferroni, Tukey, Scheffé), and trend analysis with contrasts.
- nwk16t01.sas

- [1] Kenton Food Company example (NWK Table 16.1)
- nwk17t02.sas

- [1] Rust Inhibitor Example: One way ANOVA (NWK Table 17.2)
- nwk17t06.sas

- [1] Piecework Trainees: Trend analysis (NWK Table 17.4)
Number of units produced, in relation to amount of training.
Illustrates trend analysis with contrasts, fitting a quadratic model with GLM,
and performing a lack of fit test with RSREG.
- nwk19t07.sas

- [2] Castle Bakery Example: Two way ANOVA (NWK Table 19.7)
- nwk20t03.sas

- [2] Two Factor design: Trend contrasts (NWK Table 20.3)
- nwk22t01.sas

- [2] NWK Table 22.1 Growth Hormone Data (Unequal N)
- nwk25t01.sas

- [3] ANCOVA Example, NWK Table 25.1 (Cracker promotion)
- nwk25t06.sas

- [3] Two way ANCOVA: NWK Table 25.11 (Saleable flowers)
- owners.sas

- [1] Regression approach to Anova.
A four-group design is analyzed first as an ANOVA model, then as an equivalent
regression model using {-1, 0, 1} variables.
- probsolv.sas

- [1] Data from Problem Solving Experiment
- samplef.sas

- [1] Sampling Distribution of F statistic in One Way ANOVA.
Generates 100 samples each in a 3-group design when H0 is true, and when H0 is false, to illustrate the sampling distribution of the F statistic.
- sampleg.sas

- [1] Sampling distribution of F (gplot).
Generates a high-resolution plot of the smoothed distribtions of the
F statistics found in SAMPLEF SAS.
- simple.sas

- [2] Testing Simple Effects in a 2x3 Design.
Illustrates two ways to test simple effects in a two-way design.
(In SAS 6.10, there is an easier way, using the /SLICE= option on the LSMEANS
statement.)
- smsargn.sas

- [1] Crime Rate by REGION in SMSA data Notched Boxplots
- smsargng.sas

- [1] Crime Rate by REGION in SMSA data Notched Boxplots (gplot)
- sucrose2.sas

- [1] Sucrose data: Residual Analysis to test the aptness of the model. Boxplots, and spread-level plot to find a power transformation.
- sucrose3.sas

- [1] Retrospective Power Analysis
- tukeyt.sas

- [2] Two way design, n=1: Tukey test for non additivity
- tukeytst.sas

- [2] Response times for 3 types of sentences (n=1)
- 2by3.sas

- [2] Data from a 2 x 3 Two Factor Design
- 3wayex.sas

- [3] Three Way ANOVA.
Data on effects of linguistic activity during retention and type of material
on forgetting.
Illustrates plots of interaction means, and testing trend contrasts such as
A-linear x C.
These macro programs are stored in an "autocall" library on the lab server, so you don't need to do anything special to have them included in your work. Simply include lines to call the macro program. For example (assuming you have already read in the NATIONS dataset),
%normplot(data=nations, var=imr);
will search for an load the NORMPLOT macro (if it has not already been loaded) and invoke the macro with the NATIONS data.
The
icon is linked to documentation for the macro.
See the notes on The SAS Macro Facility for information on SAS macros.
- bartlet.sas

- Bartlett's test for homogeneity of variances ;
- boxplot.sas

- Boxplots (drawn with SAS/GRAPH)
- cpplot.sas

- Plot Mallow's C(p) and related statistics for model selection
- dummy.sas

- Produces dummy variables for a discrete regression variable.
- fpower.sas

- Power as a function of Effect Size (DELTA/SIGMA) and N
- normplot.sas

- SAS macro for normal quantile-comparison plot
(printer plot version)
- nqplot.sas

- SAS macro for normal quantile-comparison plot
- meanplot.sas

- Plot the means and standard errors for a factorial ANOVA design.
- outlier.sas

- Robust multivariate outlier detection plot.
- resline.sas

- Macro to fit resistant line to XY data. Also computes a ratio-of-slopes table to diagnose the need for transformations of X or Y for linearity of regression.
- rpower.sas

- Macro for retrospective power analysis.
- scatmat.sas

- Scatterplot matrix using SAS/GRAPH.
- scatter.sas

- Scatterplot matrix using SAS/INSIGHT.
- splot.sas

- Macro for schematic plots (printer-plot version of boxplot)
- symbox.sas

- Display boxplots of a variable transformed to various powers
- symplot.sas

- Macro to display plots for making a distribution symmetric.
- tukey1df.sas

- Tukey 1 df test for Additivity
in two-way tables with n=1.
These files are set up as SAS DATA steps, ready to be used in other programs. They are stored in the DATA directory under PSY3030.
To use one of them, you can either use the menu choices File -> Open in Program Editor, or submit a %include statement such as
%include data(boston);
to obtain the BOSTON.SAS data file.
- cars93.sas

- [M] Data on 93 cars from 1993.
- auto.sas

- [M] The auto data
- boston.sas

- [M] The Boston house price data
- deaths.sas

- [M] Court awards in cases of wrongful death
- draftusa.sas

- USA Draft Lottery Data
- fitness.sas

- [M] Data on physical fitness
- fuel.sas

- [M] Fuel Consumption across the US
- nations.sas

- [S] Nations data set
- ozone.sas

- Maximum daily ozone concentrations
- rubin.sas

- [M] 51 Properties of 125 words
- sucrose.sas

- [1] Sucrose Data: Speed to traverse a Runway
- treediam.sas

- [S] Tree Data from Weisberg.
The programs below illustrate some techniques for analyzing the Project 2 data.
They are stored in the PROJECTS directory under PSY3030 (n:\psy3030\projects).
- proj2glm.sas

- Constructing contrasts for Project 2
(5x4x2 design).
- proj2gl2.sas

- Constructing contrasts for Project 2
(3x4x2 design).
- proj2plt.sas

- Plotting means for Project 2
- proj2pl2.sas

- Hi-resolution plots of means, using the %meanplot macro.
- proj2pwr.sas

- Power computations for Main Effects in 3 x 4 x 2 Design
- proj2pw2.sas

- Retrospective power analysis, using the output from PROC GLM
to determine effect size in your data.
© 1995 Michael Friendly
Author:
Michael Friendly