ReadMe.power 25 August 1998 http://www.bio.ri.ccf.org/power.html UnifyPow.sas, version 98.08.25 1998 Copyright (c) by Ralph G. O'Brien, PhD Department of Biostatistics and Epidemiology Cleveland Clinic Foundation Cleveland, OH 44195 Voice: 216-445-9451 Fax: 216-444-8023 robrien@bio.ri.ccf.org First things first: + You do NOT need to be a SAS expert to use UnifyPow. Its syntax is quite straightforward. For standard applications, UnifyPow is easy to use. Now the shameless bragging: + UnifyPow runs in SAS, so it should run in any environment that can run SAS. This includes MS Windows 3.1/95/NT, UNIX, Macintosh, CMS, MVS, OpenVMS, and OS/2. This gives UnifyPow outstanding portability. + UnifyPow builds a SAS data set of its results. SAS users can then develop customized reports, e.g., by writing their own PROC TABULATE or SAS/GRAPH code, even merging results from two or more UnifyPow runs. This gives UnifyPow outstanding reporting flexibility. + UnifyPow will handle unbalanced sample sizes in G independent groups for all relevant problems. It will compute both one- and two-tailed tests when appropriate. It will accept any alpha level. It will handle general contrasts (including dfH > 1) on cell means, logits, and Fisher's Z-transformed correlations. This gives UnifyPow outstanding depth. + UnifyPow avoids the use of crude "textbook" approximations if more exact methods are feasible. This gives UnifyPow outstanding accuracy. (Try the example below with other power analysis software.) + UnifyPow is a great value for the money. (It is still free.) The following should always be kept in mind--with any software: [One of the woes of programming] "is that designing grand concepts is fun; finding nitty little bugs is just work. With any creative activity come dreary hours of tedious, painstaking labor, and programming is no exception.... So testing drags on and on, the last difficult bugs taking more time to find than the first." ~~ Frederick P. Brooks, Jr. The Mythical Man-Month, 20th Anniversary Edition (1995) a seminal and timeless book of essays on programming Now the apology: What about the User's Guide, you ask? I have not written one. This entire project is a one-person operation, done part-time. Please bear with me. If you study the examples and workshop notes, you can run UnifyPow effectively at this point. Comments on the specific methods I have used are sprinkled throughout the code. If you like what I've done so far, please send me a kudo. They keep me motivated. If you don't like something or you want me to add something, I'd like to hear about that, too. Really. Now some technical stuff (finally): UnifyPow comes as a single text file, UnifyPow.sas. Only base SAS is needed; PROC IML is not used. All you need to do is download and store UnifyPow.sas somewhere on your computer. You then run SAS in your normal manner and %include the relevant file specification for UnifyPow.sas in your SAS code. For example, the following code will run the first example in my current workshop: title1 "UnifyPow Workshop"; *------------------------------------------------------------------; * Using non-macro version ++ ; * ++ Testing single proportion ; *------------------------------------------------------------------; /* Give SAS options, as you desire. */ options ls=78 formdlim='-' nocenter nodate nonumber nosource2; %let UnifyPow = ~robrien/UnifyPow/UnifyPow.sas; /* UNIX file spec*/ %include "&UnifyPow"; title2 "Mystic Michelle: Ordinary (pi = .50) or Gifted (pi = .80)?"; title3 "Testing a single proportion"; datalines; pi .80 . Mystic Michelle claims 80% accuracy. null .50 . (not needed because default is .50) Ntotal 20 40 alpha .05 .01 %tables; With Windows 95, I put UnifyPow in the C:\Sas\ folder and use: %let UnifyPow = C:\Sas\UnifyPow.sas; For the Macintosh, I have successfully tested UnifyPow using something like: %let UnifyPow = RalphHD1:Applications:SAS System:UnifyPow.sas; UnifyPow is also distributed in a form that runs as a SAS macro. If you have one form and want to convert it to the other, there are simple instructions in the code for doing this in a few minutes. Just search for the string "MAKE MACRO" to see the few lines to activate or inactive through commenting. The following code will run the above example using the macro version of UnifyPow: title1 "UnifyPow Workshop"; *------------------------------------------------------------------; * Using macro version ++ ; * ++ Testing single proportion ; *------------------------------------------------------------------; /* Give SAS options, as you desire. */ options ls=78 formdlim='-' nocenter nodate nonumber nosource2; %include = "~robrien/UnifyPow/UnifyPow.sas"; /* UNIX file spec*/ title2 "Mystic Michelle: Ordinary (pi = .50) or Gifted (pi = .80)?"; title3 "Testing a single proportion"; %instruct; datalines; pi .80 . Mystic Michelle claims 80% accuracy. null .50 . (not needed because default is .50) Ntotal 20 40 alpha .05 .01 %UnifyPow; The download site includes a text file called Examples.sas that contains all examples used in the current full-day workshop and other lectures, as well as the output that is generated (Examples.lst). This is for the non-macro version, corresponding to the way UnifyPow.sas is demonstrated in the workshops and probably used by most people. Another file, Examples_macro.sas, applies (obviously) to the macro version and contains the same examples. Of course, they give identical results. SAS users will notice that UnifyPow statements are read in as ordinary datalines by SAS. Each statement must begin on a new line. A few must also begin as the line's first character, i.e., avoid starting a line with spaces. Each execution of UnifyPow builds a new temporary SAS data set called PowData. This allows for great flexibility in creating custom tables, as demonstrated in some of the examples. We are now developing SAS/GRAPH modules to get graphs automatically, but for now you will have to write your own SAS/GRAPH code. To see what is in PowData, just PROC PRINT it. The first part of UnifyPow.sas contains comments with other helpful information. Now the plea: Please.... make sure you register by going to http://www.bio.ri.ccf.org/power.html I can't tell you about problems and upgrades if I don't know who you are. Thanks for your interest in my work. Ralph ============================================================================= ---------------------- UnifyPow LEGAL NOTICES ---------------------- THIS SOFTWARE IS MADE AVAILABLE "AS IS". UnifyPow is a trademark of Ralph G. O'Brien. No commercial use of this trademark may be made without prior written permission of Ralph O'Brien. All UnifyPow software and its included text and accompanying documentation are Copyright 1997 by Ralph G. O'Brien. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee to Ralph O'Brien is hereby granted, provided that these legal notices appear in all copies and supporting documentation, that the name "UnifyPow" is retained, and that the names of Ralph O'Brien and the Cleveland Clinic Foundation are not used in advertising or publicity pertaining to distribution of the software without the specific, written prior permission of Ralph O'Brien. Although the above trademark and copyright restrictions do not convey the right to redistribute derivative works, Ralph O'Brien encourages unrestricted distribution of patches or ancillary code which can be applied to or used in conjunction with Ralph O'Brien's distribution. If this software is modified for local use, please denote this on all modified versions of the software by appending the letter "L" to the current version number and by noting the changes in the code itself and in the associated documentation. RALPH G. O'BRIEN AND THE CLEVELAND CLINIC FOUNDATION DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL RALPH G. O'BRIEN OR THE CLEVELAND CLINIC FOUNDATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------------------------------------- REPORTING PROBLEMS AND MAKING SUGGESTIONS ----------------------------------------- UnifyPow's computations are checked thoroughly using multiple methods: comparing its results to those obtained by using other software, to those in published tables and examples, and to results obtained from Monte Carlo simulation. No true bugs have yet been reported in previous versions of UnifyPow, but no software can be said to be totally free of them. I really do appreciate knowing if you encounter difficulties or have suggestions for improvements. Most of the additions to UnifyPow come about this way. On the other hand, I cannot promise to address everyone's queries, especially those that are mostly related to consulting advice. I correspond best via email. Do not modify this code without obtaining written permission from me. If changes are needed for some purpose, have the wisdom and courtesy to consult me. --------------- CITING THE WORK --------------- If you use this work, please cite it--something like ... using UnifyPow, a macro for the SAS System (O'Brien, 1998). This reference is O'Brien, RG (1998), "A Tour of UnifyPow: A SAS Module/Macro for Sample-Size Analysis," Proceedings of the 23rd SAS Users Group International Conference, Cary NC: SAS Institute, 1346-1355. Another key reference for this work is: O'Brien, RG and Muller, KE (1993), "Unified Power Analysis for t Tests through Multivariate Hypotheses," in Edwards, EK. (Ed.), Applied Analysis of Variance in the Behavioral Sciences, New York: Marcel Dekker, pp. 297-344. O'Brien (1998) is updated at times and distributed via the UnifyPow website via an Acrobat (.pdf) file. The O'Brien-Muller chapter is in an outrageously expensive book. If you can't find a copy in a library, then download the Acrobat file of the original manuscript (updated a bit) from the website. Actually, the O'Brien-Muller chapter covers freeware called OneWyPow.sas and other %include modules that are now unified in UnifyPow. The current version of UnifyPow offers a simpler interface and a far larger set of methods than the old stuff did. If you have any of this still lying around, please throw it all away!