Programs & Utilities
Available Programs and Utilities
These materials are all available via Box. Please contact Dr. Ron Hays at drhays@ucla.edu with any questions or requests for access.
Download Programs & Utilities on Box
TEXT files such as .sas, .log, .lst, .mac, .DAT, .in, .bat, .for, .bas, .out, etc. have been converted to RTF format (see grip_feb18-04.sas or gutt.dat below) but should be converted back once downloaded to your system.
We assume no liability for use of programs/utilities on this page. The onus is on the user to verify the accuracy of their results.
Publications
- Hays, Ron D. Estimating PROMIS Scores Using SAS. (November 4, 2021).
- Spritzer, KL & Hays, RD. Calculating Physical and Mental Health Summary Scores for PROMIS-29 v2.0 and v2.1. August, 2018.
Downloads
Download Programs in Box
Scoring of PROMIS-29+2 Profile V2.1 (2/15/21)
Note: Codes and programs are bolded below.
- PROP-29+2 guide.pdf: A complete guide to scoring PROMIS-29+2.
- export29+2.sas.rtf, export29+2.log.rtf, export29+2.pdf: reads your data and outputs
- prom29plus2.csv (rtf) for scoring in AC
- prom29plus2.sas7bdat for further processing.
- prom29plus2ex.csv.rtf, prom29plus2ex_log.csv.rtf: files the AC scoring service generates.
- score29+2.sas.rtf, score29+2.log.rtf, score29+2.pdf: SAS code to restructure output from scoring service; incorporate PROPr code and create PH29 and MH29 summary scores.
- Generic MAUT code 2017_09_01.sas.rtf (PROPr code from Janel Hanmer incorporated into score29.sas): https://github.com/janelhanmer/PROPr#readme
R code for simulations
- Hays, R. D., Spritzer, K. L., & Reise, S. P. (Sept 2021). Using item response theory to identify responders to treatment: Examples with the Patient-Reported Outcomes Measurement Information System (PROMIS) physical functioning and emotional distress scales. Psychometrika, 86 (3): 781-792. (citation updated 11/26/21)
JPRO
- Steps to JPRO Editorial Report for Articles Handled in 2020 (8/9/20)
- Example review of article (10/22/20)
- Guide to requesting reviewer suggestions (10/22/20)
[NOTE: several programs (exe versions) were compiled using early version of BASIC or FORTRAN using pre-64bit machines.]
ordalpha
- Spritzer, K.L. & Hays, R.D. (2015, December). A SAS Macro (ordalpha) to compute ordinal Coefficient Alpha. University of California, Los Angeles.
- The SAS macro: ordalpha.mac
- Example of execution: ordalphsetup.sas (code), ordalph_setup.log, ordalph_setup.lst, ordalph_setup.pdf (output)
Recycled Predictions in SAS
- Hays R. D., & Spritzer, K. L. (2013, November). REcycled Sas PrEdiCTions (RESPECT). Paper presented at the Society for Computers in Psychology meeting, Toronto, Canada.
- The SAS macro: HaysRecycle.mac
- Example of execution: respect_example_022114.sas (code), respect_example_022114.lst (output)
- Updated February 2014
Parallel
- Hays RD. (1987). PARALLEL: A program for performing parallel analysis. Applied Psychological Measurement. 11, 58.
- The executable: PARALLEL.EXE .
Multi
- Hays RD & Wang E. (1992, April). Multitrait Scaling Program: MULTI. Proceedings of the Seventeenth Annual SAS Users Group International Conference, 1151-1156.
- Sample program including macro call: MULTI.sas and its output: MULTI.out.
- Hays, R.D. & Hayashi, T. (1990). Beyond internal reliability: Rationale and User's Guide for Multitrait Scaling Analysis Program on the microcomputer. Behavior Research Methods, Instruments & Computers, 22, 167-175.
- August 2012: testing an updated version of Dr. Hays' MULTI macro that will analyze surveys with > 99 items.
- macro: multi100.mac.sas
- sample program with macro call & output from macro.
- User's Guide for the Multitrait Analysis Program (MAP). Hays, R. D., Hayashi, T., Carson, S., & Ware, J. E. (1988). User's Guide For The Multitrait Analysis Program (MAP). Santa Monica, CA: The RAND Corporation, N-2786-RC.
GRIP
- Hays RD, Wang E, & Sonksen M. (1995, September). General Reliability and Intraclass Correlation Program (GRIP). Proceedings of the 3rd Annual Conference of Western Users of SAS Software. (Uploaded 2013)
- 6/2/2003: replaced with a version modified by Sally Carson and Karen Spritzer -- adds NREL70, NREL80, NREL90, and NREL95 plus now able to run under SAS 8.0.
- 2/18/04: updated to fix a problem that came about because SAS 8 is case sensitive with respect to variable names. The macro and sample call: grip_feb18-04.sas
- 1-Way GRIP Example found in Box. (Jan 2013)
WKAPPA
Liu H, & Hays RD. (1999, April). Measurement of interrater agreement: A SAS/IML macro kappa procedure for handling incomplete data. Proceedings of the SAS Users Group International Conference, 1620-1625.
SAS macro (same version in text and WORD:
- wkappa.txt (text) wkappa.doc (WORD).
- Visit the SAS paper in Box above.
- 2/4/14: for header documentation of wkappa.txt: for unweighted version use "uwt" for in macro call - NOT "uw".
- Examples for Table 1 in paper with "frequency" option: Table1_uwt.sas, Table1_uwt.lst.
- Example for tabel 2 in paper: Table1_f_uwt.sas, Table1_f_uwt.lst.
- Example for Table 2 in paper: Table2.sas, Table2.lst.
Other Helpful Programs
Scoring the SF-36 version 1.0 (using1990 General Population norms)
Note: See alternative code to use 1998 norms.
- Hays RD, Sherbourne CD, Spritzer KL, & Dixon W J. (1996) A Microcomputer Program (sf36.exe) that Generates SAS Code for Scoring the SF-36 Health Survey. Proceedings of the 22nd Annual SAS Users Group International Conference, 1128-1132.
- The executable described in this paper is no longer current, but the above article serves as a good guide to using the following SAS code (sf36.sas, and US general population data, and sf36.raw) to analyze your data.
- We provide the executable and other files referenced in the paper for historical purposes only (sf36.exe, sf36.in, sf36b.exe).
- Visit "sugi22" Posters paper in Box above.
Alternative set of code expanding on scoring SF-36 version 1.0
Note: Uses 1990 General Population norms, but has the option to use1998 norms.
- Program to score the SF-36 version 1.0.
- All sections require SF36 version 1.0 items to be named i1-i36 and ID variable named ID (in order to merge the various output datasets).
- One section (sf36b.sas) requires a variable for gender named MALE (=1 if male, =0 if female) and a variable for AGE (continuous).
- Note: if you want to run sf36b.sas, you must run sf36a.sas prior to it. Code to calculate Fryback's QWB is in fryback.sas and is called from sf36a.sas. The %include can be commented out if not needed. Similarly, code to calculate Nichol's HUI2 (hui2.sas) is called from sf36c.sas and can be commented out or omitted if not needed.
Instructions:
- Download main program (score1.sas) and its components:
- randhsi.sas [RAND-36 HSI score]. sf36a.sas [SF-36 scores and optionally Fryback's Quality of Well-Being Score], sf36b.sas [comparison to US general population], and sf36c.sas [SF-36 and SF-12 physical and mental health composite scores and factors (using 1990 General Population norms) and Nichol's Health Utility Index].
- Note: randhsi.sas updated as of 6/30/2010.
- Note: to use the Means/SD's from the 1998 General Population, download and use score1-1998.sas and sf36c1998.sas (instead of score1.sas and sf36c.sas).
- Note: QWB (not just QWB100) code change in Fryback code (fryback.sas above) and files that call it up (6/30/2008).
Scoring the SF-36 version 2.0
- code: sf36v2-4_public.sas (3/16/07)
- output from test dataset: sf36v2-4_public.lst (3/16/07)
Scoring Brazier's Index (SF-6D):
SAS code to score U.S. versions:
- sf36 v1 (code, test output)
- sf36 v2 (code, test output)
- sf12 v1 (code, test output)
- sf12 v2 (code, test output)
Scoring the SF-12 version 1.0
Updated 2016
(Short: sf12 summary measures only): See SAS code SAS listing on Box.
Scoring the SF-12 version 2.0
SAS code to score the SF-12 version 2.0. Assumes your items are named I1, I2a-b, I3a-b, I4a-b, I5, I6a-c, I7. Rename them in the first data step if they are not.
Code: sf12v2-1.sas.
Output from test dataset: sf12v2-1.lst (8/24/04)
Mosier's formula
- Mosier's formula (Mosier, C.I. (1943)). On the reliability of a weighted composite. Psychometrica, 8, 161-168.
- Estimation of reliability of composite scores. Download files mosier.exe, mosier.in, and mosier2.in on Box above.
Note: Trailing blanks MUST be removed from input file in order for program to run successfully. You can see these trailing blanks if you open up "mosier.in" in your editor (notepad, for example) and type "control-A."
- Mosier-input.doc is the annotated test input file
- Mosier.out is the test output.
- Reference for Mosier formula is mosier.JPG (taken from: Hays, Ron D. Evaluating Self-Report Data Using Psychometric Methods. Lecture in Quality of Care Course. RAND, Santa Monica CA: February 11, 2004.
- See PowerPoint presentation in Box: QOC-feb11-04.ppt.
- mosier.bas: original BASIC code for mosier (posted 3/10/14).
- SAS version of mosier program: for 32bit windows and 64bit windows.
- Note: Copy the SAS catalog file (sasmacr.sas7bcat) to a folder of your choosing and follow along with one of the examples below.
- Example 1: mosier_test.sas with input data mosier_test.in and output mosier_test.lst.
- Example 2: mosier_test2.sas with input data mosier_test2.in and output mosier_test2.lst.
- Update 2014: mosier_test.in (and mosier_test2.in) follow same format and conventions as input file used in Ron Hays' mosier.exe program, i.e. - only reads first 80 columns for composite name and first 8 columns for scale names.
- This program differs in that you no longer need to have the weights/SDs/reliabilities conform to a fixed number of columns for input. Make sure there is space between these data points.
- Note: We've rounded the value of mosier to .0001 when output.
MTMM
- Hayashi, T., & Hays, R. D. (1987). A microcomputer program for analyzing multitrait-multimethod matrices. Behavior Research Methods, Instruments, And Computers, 19, 345-348.
- Used to evaluate multitrait-multimethod correlation matrices. Download files in Box above: mtmm.exe and mtmm.in.
AUC/ROC
- Hays, R. D. (1990). ROC: Estimation of the area under a receiver operating characteristic curve. Applied Psychological Measurement (Computer Program Exchange), 14, 208. Assess the area under the receiver operating characteristic curve.
- Download files in Box folder above: area.exe, area.in, area2.exe, and area2.in.
- See documentation for area.exe (5/9/2008).
Longitudinal Scalogram Analysis (LSA)
- Hays, R. D. & Ellickson, P. L. (1990). Longitudinal scalogram analysis: A methodology and microcomputer program for Guttman scale analysis of longitudinal data. Behavior Research Methods, Instruments & Computers, 22, 162-166.
- Hays, R. D. & Ellickson, P.L. (1991). Guttman scale analysis of longitudinal data: A methodology and drug use application. International Journal of the Addictions, 25 (11A), 1341-1352.
- Ellickson, P. L., Hays, R. D., & Bell, R. M. (1992). Stepping through the drug use sequence: Longitudinal scalogram analysis of initiation and heavy use. Journal of Abnormal Psychology, 101, 441-451.
- Hays, Ron D. (1991). User's Guide for the Longitudinal Scalogram Analysis Program.
LSA Program and test data
- input - sample input
- output - output from analysis
- raw.new
- lg.out
- lg2.out
- go.bat - batch file that drives the following executables - requires "RAW" as input)
- lgint.exe
- ll.exe
- llll.exe
Source code for LSA programs (FORTRAN and BASIC)
lg.for
ll.bas
lll.bas
llll.bas
prelsa.bas
STEIG
- steig.exe: tests significance of difference of paired correlations.
- Note: you can run this as a Windows application but the results will blip by you too fast to write them down. The preferred approach is to open up a DOS window and run it from there.
- In this program R1 and R2 are the correlations being compared to see if they are significantly different from one another. R3 is the correlation between the variables that are unique to R1 and R2.
- For example if the correlation between x and y (R1) is being compared to the correlation between z and y (R2) then R3 is the correlation between x and z.
CORRDIFF
- corrdiff.bas: tests significance of difference of independent correlations (written in BASIC)
- corrdiff.sas: tests significance of difference of independent correlations (written in SAS)
HAYSPOWE
- hayspowe.bas: power analysis program for limited situations
- Hayspowe.sas: SAS 8.0 version of hayspowe.bas (8/23/04)
- hayspowe.out: sample output from hayspowe.sas (8/23/04)
Power is the probability of rejecting the null hypothesis (e.g., two groups do not differ on physical functioning) when the alternative hypothesis (the two groups differ) is true.
Here, we provide a SAS program and output Here we provide a SAS program and output from the program that shows some common power analyses. Specifically, the program provides the sample sizes needed to detect differences between two experimental groups (Tables 1 and 2) and two self-selected groups (Table 3).
The SAS program (hayspowe.sas) requires as input (at end of the SAS program just after “%hayspowem”) the title for the power analysis, number of scales in the analysis, the standard deviation of each scale, and each scale’s label. The output shows the sample size needed for a point difference of 2, 5, 10, and 20 points.
The example output file (hayspowe.out) provides power analysis results for three scales (physical functioning, emotional well-being, social functioning). Table 1 indicates, for example, that one would have 80% power (alpha = 0.05) with a sample size of 82 (41 per group) to detect a 10-point difference in physical functioning (SD = 20.10) using a two-tailed t-test if you had a repeated measures design and a correlation of 0.60 between physical functioning scores at the two time points. If physical functioning were measured only at one time point (follow-up), you would need a sample of 126 (63 per group) to have the same power.
ALPHATST
- alphatst.exe: tests significance of difference between alpha coefficients (see alphatst.doc documentation of how to construct input file for alphatst.exe and alpha.exe; also provides sample output from alphatst.exe).
- alpha.exe: updated version of alphatst.exe. [2003]
2014 example:
Sample input for alpha.exe and alphatst.exe: alpha.txt
Output from alphatst.exe and alpha.exe
- Note: Output files to reflect which program they came from, but output filename comes hardcoded from your input - alpha.txt in this case. Both programs will abort if the output file you specified in your input file is present , i.e., will not overwrite the file.
A description of the formula used to estimate the significance of difference between alpha coefficients can be found in the article:
Feldt, L.S., Woodruff, D.J., and Salih, F.A. (1987) Statistical Inference for Coefficient Alpha. Applied Psychological Measurement, 11, 1, 93-103.
- alphanew.for: original FORTRAN code for alpha
Other Resources
- Adjusting for Clustering (Non-Independence Among Observations) using SAS - March 28, 2008.
- NOTE: SAS has implemented the adjustment within PROC surveyreg.
- See Box for example code.
Information on lsmeans
Spear.exe
- spear.exe: applies Spearman-Brown prophecy formula to reliability estimates
- spear.bas, spear2.bas: original BASIC code for spear (posted 3/10/14).
- NEW: spear2022.sas.rtf updated version written in SAS (July 2022); output (spear2022.pdf).
Additional Resources
- multi_p.sas: derived from multi.sas - pairwise correlations.
- Guttman scaling: scalo.exe, gutt.dat, sample.dat, test.dat, scale.out -- this program assesses the extent to which the items fit a response pattern that is consistent with a Guttman scale.
- nfact.sas: this is a macro that helps determine the number of factors to rotate in a factor analysis. In general, specify the maximum number of factors you might expect in the NFACT macro to maximize the information you will get to help determine the number of factors to rotate.
- Note: 2nd step (after the "endsas") does the rotation and creates the factor scores.