Combining the Results from Multiple SAS PROCS into a Publication Quality Table

Size: px
Start display at page:

Download "Combining the Results from Multiple SAS PROCS into a Publication Quality Table"

Transcription

1 Combining the Results from Multiple SAS PROCS into a Publication Quality Table Robert Kabacoff, Management Research Group, Portland, ME ABSTRACT Data analysts are often faced with the daunting and repetitive task of extracting information from multiple SAS procedures and combining them into an attractive publication-ready table. This paper demonstrates simple methods of accomplishing this task using SAS MACRO, SAS ODS, PROC REPORT and PROC FORMAT. A SAS macro (%WILCOXON) is developed for examining difference between two groups on a set of ordinal or continuous outcomes. The user specifies a SAS data set, a binary grouping variable, and one or more outcome variables. The macro then generates a set of analyses using PROC NPAR1WAY and PROC MEANS, calculates an effect size for each group difference, and generates a compact, publication quality table. Optionally, the user can sort the results, add annotations, and generate publication quality graphs. INTRODUCTION Data exploration and statistical analyses are rarely the final step in a research project. The results have to be communicated to an audience (colleagues, students, journal reviewers) in an easily understandable format. SAS procedures provide comprehensive analytic capabilities, but their outputs are rarely publication ready. Consider a study of gender differences in management. Male and female department heads completed the Individual Directions Inventory (IDI, Management Research Group, 1998), a psychological instrument measuring 17 motivations or emotional drivers. The scales are reported in percentile rank scores normed against a large US business population. Since percentile rank scores are inherently ordinal, a reasonable approach would be to assess group differences using a nonparametric Wilcoxon test (equivalent to a Mann Whitney U test) (Siegel & Castellan, 1988). The results are displayed in figure 1. The first column lists the dependent variables, the second and third columns contain the group medians, the fourth column gives the two-tailed significance levels for the Wilcoxon tests, and the fifth column reports the effect sizes, expressed as odds. It is easy to scan this table and assess the group differences. For example, men tended to score higher than women on the motivator Winning (with medians 65 and 45 respectively), and the difference was statistically significant at p < From the effect size, we would estimate that a randomly selected male is almost twice (ES =1.85) as likely to score higher than a randomly selected woman on this variable. Conversely, women scored higher on Gaining Stature (p <.05) and were 1.4 times more likely to score higher than men. Effect sizes are very useful for ordering the magnitude of the group differences - especially when the dependent variables are not in the same metric. Fig 1. Table Produced by %WILCOXON Macro Table. Group Differences by Gender Medians Significance Variable Male Female p 1 ES 2 (N) Giving Receiving Belonging Expressing Gaining Stature Entertaining Creating Interpreting Excelling Enduring Structuring Maneuvering Winning Controlling Stability Independence Irreproachability Wilcoxon Test 2 Probability-based effect size expressed as odds 1

2 To analyze this data in SAS, we could use PROC NPAR1WAY to obtain Wilcoxon tests. The following code proc npar1way data=idi wilcoxon; class gender; var give--irrp; produces one page of output for each dependent variable, for a total of 17 pages. The results for the first variable (give) is provided in figure 2. The Wilcoxon 2-groups test is clearly not significant (p =.1583) for this variable at any reasonable level of alpha (e.g.,.05). Fig. 2.Output from PROC NPAR1WAY Wilcoxon Scores (Rank Sums) for Variable give Classified by Variable gender Sum of Expected Std Dev Mean gender N Scores Under H0 Under H0 Score Male Female Average scores were used for ties. Wilcoxon Two-Sample Test Statistic Normal Approximation Z One-Sided Pr > Z Two-Sided Pr > Z t Approximation One-Sided Pr > Z Two-Sided Pr > Z Additional results and 16 additional pages The medians for each group can be obtained using PROC MEANS: proc means data=idi median; class gender; var give--irrp; Fig. 3. Output from PROC MEANS The results are displayed in in figure 3. Unfortunately, the arrangement of the medians on the printout makes direct comparisons between groups a difficult (compare this with figure 1). In addition, most journals now require an estimate of effect size in addition to whether or not the difference is statistically significant. Neither printout provides such a measure. N Gender Obs Variable Label Median Male 156 give Giving recv Receiving blng Belonging expr Expressing gnst Gaining Stature more variables Female 107 give Giving recv Receiving blng Belonging expr Expressing gnst Gaining Stature more variables 2

3 The challenge for the analyst is how to take the 18 pages of SAS printout produced by PROC NPAR1WAY and PROC MEANS, calculate effect sizes and save the results as a publication-ready table. The remainder of this paper describes the typical steps involved in extracting information from SAS PROCs and assembling a publication quality table in RTF format. RTF files are easily incorporated into Microsoft Word or PowerPoint documents common file formats for presentations and publication submissions. A macro (%WILCOXON) is also provided to demonstrate the application of these techniques. It performs a nonparametric Wilcoxon two independent groups test on a set of dependent variables, calculates effect sizes, and saves the results in a publication ready RTF formatted table. The macro optionally sorts the results by effect size, annotates the results by replacing significance levels with stars, and generate a variety of publication quality graphs that are useful for visualizing group differences, These include an effect size plot, comparative box plots and comparative histograms with superimposed kernel density curves. Each is generated in a publication quality format and saved in the same RTF file. SAVING SAS PROC RESULTS IN A PUBLICATION READY TABLE A typical process for incorporating the results of multiple SAS PROCs into a publication quality table are given in the following figure: Save the results of the SAS PROCs into SAS datasets using PROC output options or ODS. Reformat the SAS datasets and compute any additional statistics. This is done through DATA step programming and may require PROC TRANSPOSE to change rows into columns, depending on the output in step 1. Combine the SAS datasets using either a DATA step or PROC SQL. The combined dataset should contain all the information needed for the final table. Open an RTF destination file via ODS RTF. Print the publication quality table using PROC PRINT or PROC REPORT. Close the RTF destination file. Each step is illustrated below, using the gender data discussed previously. Before starting, be sure that each dependent variable has a variable label. These labels will appear in the publication-ready table. 3

4 STEP 1. SAVE THE REULTS OF THE PROC NPAR1WAY AND PROC MEANS The output from PROC NPAR1WAY can be saved to a SAS dataset using the code proc npar1way data = idi noprint wilcoxon; class gender; var give--irrp; output out = T1(keep = _var_ p2_wil _wil_) wilcoxon; The contents of the dataset (_t1) are given in figure 4. The variable _WIL_ contains the Wilcoxon statistic, while P2_WIL contains the probability value for a two tailed test. Fig 4. Dataset T1 Obs _VAR WIL_ P2_WIL 1 give_pct recv_pct blng_pct expr_pct gnst_pct more observations The output from PROC MEANS can be saved to a SAS dataset using the code proc means data = idi noprint; class gender; var give--irrp; output out = T2 median=; The contents of the dataset (T2) are displayed in figure 5. The first observation contains the total sample medians, while the second and third observations contain the medians for males and females respectively. Fig 5. Dataset T2 g r b e g e c i e e s m w c s i i i e l x n n r n x n t a i o t n r g v c n p s t e t c d r n n n a d r e T F e v g r t r a g l r c v n t b p p n Y R _ O d P E p p p p p p p p p p p p p p p p p b e E Q c c c c c c c c c c c c c c c c c s r t t t t t t t t t t t t t t t t t Male Female Although the OUTPUT OUT= option was used in the code above, ODS OUTPUT could have been used as well. For example, the first set of code could have been re-written as ods listing close; ods output WilcoxonTest = T1; proc npar1way data = idi; class gender; var give--irrp; ods output close; ods listing; Datasets created by ODS OUTPUT and the OUTPUT or OUT option in a SAS PROC will usually differ in terms of variable names and data arrangement. An advantage of the ODS OUTPUT approach is that it can save results from PROCS that do not have output options. However, the format of datasets created with the OUTPUT OUT= option are often easer to work with. Both approaches can work, and the choice between them is often one of convenience or availability. The remainder of this example assumes that the OUTPUT OUT= approach is used. 4

5 STEP 2. REFORMAT THE DATA SETS AND CALCULATE EFFECT SIZES In order to build a table that looks like the one in figure 1, the medians in T2 need to be inverted and effect sizes calculated. Dataset T2 can be inverted using proc transpose data = T2 out = T2 name = _VAR_; id gender; The results are displayed in figure 6. Fig. 6. Dataset T2 (transposed) Obs _VAR LABEL_ Male Female 1 _TYPE_ _FREQ_ give_pct Giving recv_pct Receiving blng_pct Belonging expr_pct Expressing gnst_pct Gaining Stature more observations Effect Size A nonparametric measure of effect size that is appropriate for the Wilcoxon test is A = [#Y 1 > Y 2 ) +.5#(Y 1 =Y 2 )]/n 1 n 2 where # is the count function, Y is the dependent variable, n is the sample size, and the indexes refer to group 1 and group 2 (Ruscio, 2008). Effect size A estimates the probability that an individual in one group will score higher than an individual the other group, allowing for ties. It can be be re-expressed as the odds that an individual in one group will score higher than an individual in the other group by using the formula odds = A / 1 A. The formula for effect size A can be derived from the Mann Whitney U statistic and group sample sizes using A = n 1n 2 U n 1 n 2 PROC NPAR1WAY does not report the U statistic, but it is easily obtained from the Wilcoxon statistic using the formula U = W n s(n s + 1) 2 where n s is the smaller of the two sample sizes. The Wilcoxon statistics are contained in table t1. Calculating the Effect Size in SAS In order to calculate the effect sizes, it is convenient to save the sample sizes for the two groups in macro variables n1 and n2. This can be accomplished with the code proc freq data = idi noprint; tables gender / out = Nobs ; data _null_ ; set Nobs; if _N_ eq 1 then call symputx('n1', count); else if _N_ eq 2 then call symputx('n2', count); The effect sizes can then be calculated added to dataset T1 using data T1; set T1; ns = min(&n1, &n2); U = _WIL_ - (ns * (ns + 1)) / 2; A = (&n1 * &n2 - U) / (&n1 * &n2); odds = A / (1 - A); if A lt 0.5 then odds = 1 / odds; 5

6 Inverting the odds when they are less than 0.5 maintains the relationship that larger odds are associated with larger effects. The direction of the effect can be determined by examining the group medians. STEP 3. COMBINE THE DATASETS Dataset T1 containing the test statistics and effect sizes can be combined with dataset T2 containing the medians using PROC SQL and cleaned up using a DATA step. The results are saved as dataset T3 (figure 7). proc sql; create table T3 as select * from T2 left join T1 on T1._var_ = T2._var_; quit; data T3; set T3; if _var_ eq '_FREQ_' then _label_ = '(N)'; else if _var_ eq '_TYPE_' then delete; Fig. 7. Dataset T3 Obs _LABEL_ Male Female P2_WIL odds 1 (N) Giving Receiving Belonging Expressing Gaining Stature Entertaining Creating Interpreting Excelling additional observations Dataset T3 now has everything needed to create a publication quality table. STEP 4. OPEN AN RTF DESTINATION The most common format for submitting documents for publication is Microsoft Word. The ODS RTF statement will save results in rich text format that can be easily imported into Word documents as well as PowerPoint presentations. The code ods rtf file = 'myresults.rtf' startpage = never style = Journal bodytitle; ods escapechar = '~' ; will create an RTF document called myresults.rtf and save subsequent output to this file in Journal style (a simple style useful for publishing). The ~ character is specified as an ODS escape character that will be useful for embedding RTF code in the file. STEP 5. PRINT THE TABLE USING PROC REPORT While PROC PRINT can be used to print the dataset (T3 in this case), PROC REPORT provides greater control over the final formatted results. Getting the table to look just right is usually a matter of successive approximations. First, let s set up the structure of the table: proc report data = T3 nowindows; col (_label_) ('Medians' Male Female) ('Significance' P2_WIL odds); define _label_ / "Variable" ; define P2_WIL / "p"; define odds / "ES"; title "Table. Group Differences by Gender"; The resulting table is given in figure 8a. It looks good, but we want the table and title to be left justified, the column headings to be right justified (except for the first one), 2 digits after the decimal place for the p column and 3 digits after the decimal place for the ES column. We also want the font to be in Times New Roman instead of Arial. 6

7 Fig 8a. First Approximation Table. Group Differences by Gender Medians Significance Variable Male Female p ES (N) Giving Receiving Belonging Expressing Gaining Stature Entertaining Creating Interpreting Excelling Enduring Structuring Maneuvering Winning Controlling Stability Independence Irreproachability We can accomplish this by making the following additions to the code: proc report data = T3 nowindows style(report) = { just = left} style(header) = {font = ("times new roman", 10pt) just = right} style(column) = {font = ("times new roman", 10pt)}; col (_label_) ('Medians' Male Female) ('Significance' P2_WIL odds); define _label_ / "Variable" style(header) = {just = left} ; define P2_WIL / "p" format = 5.3; define odds / "ES" format = 4.2; title j = left "Table. Group Differences by Gender"; The resulting table is displayed in figure 8b. 7

8 Fig 8b. Second Approximation Table. Group Differences by Gender Medians Significance Variable Male Female p ES (N) Giving Receiving Belonging Expressing Gaining Stature Entertaining Creating Interpreting Excelling Enduring Structuring Maneuvering Winning Controlling Stability Independence Irreproachability The table is almost there. As a final step, we ll fix the font and style of the title and add foonotes. We can accomplish both tasks with the insertion of RTF style code: proc report data = T3 nowindows style(report) = { just = left} style(header) = {font = ("times new roman", 10pt) just = right} style(column) = {font = ("times new roman", 10pt)}; col (_label_) ('Medians' Male Female) ('Significance' P2_WIL odds); define _label_ / "Variable" style(header) = {just = left} ; define P2_WIL / "p~{super 1}" format = 4.2; define odds / "ES~{super 2}" format = 4.2; compute after _page_/left; line "~S = {font = ('times new roman', 8pt) just = left} ~{super 1}Wilcoxon Test"; line "~S = {font = ('times new roman', 8pt) just = left} ~{super 2}Probability-based effect size expressed as odds"; endcomp; title "~S = {font = ('times new roman', 11pt) just = left}" "Table. Group Differences by Gender"; 8

9 The final table is given in figure 8c which is what we started with in figure 1. Fig 8c. Final Table Table. Group Differences by Gender Medians Significance Variable Male Female p 1 ES 2 (N) Giving Receiving Belonging Expressing Gaining Stature Entertaining Creating Interpreting Excelling Enduring Structuring Maneuvering Winning Controlling Stability Independence Irreproachability Wilcoxon Test 2 Probability-based effect size expressed as odds As a final step, you may want to replace the probability values in column 4 with stars or asterisks. This can easily be accomplished with PROC FORMAT. See the %WILCOXON source code and figure 9 for an example. See Carpenter (2007) for an overview of basic PROC REPORT statements and Pass (2002) for an introduction to style elements. STEP 6. CLOSE THE RTF DESTINATION To complete the process, close the RTF destination. ods rtf close; 9

10 THE %WILCOXON MACRO Using the approaches described above, the %WILCOXON macro produces a Wilcoxon Mann Whitney test of group differences and outputs the results in an attractive format to an RTF file. The call is %WILCOXON(data=, var=, class=, optional parameters); where Parameter Values Description data dataset name SAS dataset containing the data to be analyzed. Default is _LAST_. var variable list List of numeric dependent variables. class variable name Dichotomous independent variable. file filename Output RTF file. Default is results.rtf. medianfmt format Print format for medians. order DATA, ES Sort results by dataset variable order (DATA) or by effect size (ES). Default is DATA stars YES, NO Replace table probabilities with stars. Default is NO. effectsplot YES, NONE Produce an effect size dot plot. Default is NONE. compareplot HIST, BOX, NONE Produce comparative histograms (HIST) or box plots (BOX). Default is NONE. alpha 0< number <1 Limit comparative plots to dependent variables with class differences that are significant at level alpha. Default = 1 (do not limit). orientation PORTRAIT, LANDSCAPE Page orientation. Default is PORTRAIT. height length Height of plots. Default is 3.5in. Specify blank to revert to SAS default. width length Width of plots. Default is 5in. Specify blank to revert to SAS default. For example, the call %WILCOXON(data = idi, class = gender, var = give--emph ); produced the table in figure 1. The call %WILCOXON(data = idi, class = gender, var = give--emph, order = ES, stars = YES, effectsplot = YES, compareplot = HIST); produces the table in figure 9, the effects dot plot in figure 10, and comparative histograms for each dependent variable. The comparative histogram for Winning is displayed in figure

11 Figure 8 shows the effect of the order=yes and stars=yes options. The variables have been sorted in descending order by effect size. The probability values have been replaced by stars and an annotation has been added to the footnotes. PROC FORMAT is used to replace the actual probability values with the asterisks. Fig 9. Table Produced by %WILCOXON Macro (with sorting and annotation options) Table. Group Differences by Gender Medians Significance Variable Male Female p 1 ES 2 Winning **** 1.85 Creating ** 1.54 Receiving * 1.43 Gaining Stature * 1.37 Maneuvering * 1.36 Expressing Giving Enduring Structuring Excelling Irreproachability Belonging Independence Entertaining Interpreting Stability Controlling (N) Wilcoxon Test * p <.05, ** p < 0.1, *** p <.001, **** p < Probability-based effect size expressed as odds The effects plot (figure 9) is useful for assessing the relative magnitudes of the group differences on the dependent variables. In this case it highlights the size of the Winning difference. An effect size (odds) of 1.0 implies no differences between the groups. The row order will match the table (ES order in this case). 11

12 Fig 10. Sorted Effect Size Plot The comparative histogram for Winning is given in figure 10. Fig 11. Comparative Histograms with Kernel Density Curves 12

13 The plot shows the histograms for the two groups with superimposed kernel density curves. The insets in each graph give the group sample size, dependent variable median and median absolute deviation. The later is a useful measure of spread when the outcome variable is ordinal. If the option compareplot=hist is replaced with compareplot=box, comparative box plots are produced. An example is given in figure 11. Fig 11. Comparative Box Plots The histograms and box plots are created with SAS Statistical Graphics procedures (PROC SGPANEL and PROC SGPLOT). Users can modify the appearance of these graphs through the Graph Template Language and PROC TEMPLATE (Kuhfeld, 2010). This allows you to create publication quality graphs that meet the requirements of the a given publisher or organization. CONCLUSIONS Publication quality tables can be created from almost any combination of SAS procedures by saving SAS PROC results to data sets, modifying and combining them, and printing them to an RTF destination. SAS ODS, PROC SQL, PROC FORMAT, and PROC REPORT give you all the tools you need. The current paper demonstrates a macro for nonparametric two group comparisons, but this macro is easily extended to multi-group parametric and nonparametric approaches. REFERENCES: Carpenter, A. (2007). PROC REPORT basics: Getting started with the primary statements. Paper presented at PNWSUG Retrieved from Kuhfeld, W. F. (2010). Statistical Graphics in SAS: An introduction to the Graph Template Language and the Statistical Graphics Procedures. NC: SAS Institute. 13

14 Management Research Group. (1998). Individual Directions Inventory: Technical Manual. Portland, ME: Author. Pass, R. (2002). PROC REPORT: Doin it in style! Paper presented at SUGI27. Retrieved from Ruscio, J. (2008). A probability-based measure of effect size: Robustness to base rates and other factors. Psychological Methods, 13, Siegel, S., & Castellan Jr., J. N. (1998). Nonparametric statistics for the behavioral sciences (2 nd ed.). NY: McGraw-Hill. ACKNOWLEDGMENTS SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Robert Kabacoff, Ph.D. Management Research Group 14 York Street, Suite 301 Portland, ME rob.kabacoff@mrg.com The %WILCOXON macro can be downloaded from 14

15 Appendix. Source code of Macro %WILCOXON /* * Macro Name: WILCOXON Author: Robert Kabacoff Creation Date: June 2011 SAS Version: 9.2 Purpose: %WILCOXON produces an Wilcoxon-Mann-Whitney test of group differences and outputs the results in an attractive format to a RTF document. Given a set of ordinal dependent variables and a categorical variable representing two independent groups, WILCOXON generates a publication quality table summarizing results. The first column contains the dependent variable names, the second and third columns contain the group medians, the fourth column contains significance levels from statistical tests of group differences, and the fifth column contains a probability-based measure of effect size (A) expressed as odds. Optionally, significance levels can be replaced by stars and results can be sorted by effect size. An effect plot and comparative histograms or box plots for each dependent variable can also be generated. Output: Results as an RTF document * * Call: %WILCOXON (data =, var =, class =, file =, medianfmt =, order =, stars =, effectsplot =, compareplot =, alpha =, orientation =, height =, width = ); * * Required Parameters: data - Name of a SAS dataset var - List of numeric dependent variables class - Categorical independent variable * * Optional Parameters: General file - Output RTF file. Default is results.rtf. medianfmt - Print format for medians. order - Sort results by dataset variable order (DATA) or effect size (ES). Default is DATA. orientation - PORTRAIT or LANDSCAPE. Default is PORTRAIT For Table stars - Replace probabilities with stars. Default is NO. For Plots effectplot - Produce effect dot plot. Default is NONE. compareplot - Produce comparative histograms (HIST) or box plots (BOX). Default is NONE. 15

16 alpha - Limit comparative plots to dependent variables with class differences that are significant at alpha. Default = 1 (do not limit). height - Height of plots. Default is 3.5in. Specify blank to revert to SAS default. width - Width of plots. Default is 5in. Specify blank to revert to SAS default. * * Limitations: The combined length of all dependent variables names must be < 201. Listwise deletion of missing values is employed. At least one dependent variable MUST have a variable label. * */ %macro WILCOXON( data=_last_ /* dataset to be analyzed */, var = /* list of dependent variables */, class = /* grouping variable */, file = results.rtf /* RTF file to be created */, medianfmt = 4.0 /* print format for medians */, order = DATA /* order or results */, stars = NO /* replace actual p levels with stars */, effectsplot = NO /* generate effect size dot plot */, compareplot = NONE /* generate group comparison plots */, orientation = PORTRAIT /* page orientation */, alpha = 1 /* limit plots to variables that are significant */, height = 3.5in /* height of graphs */, width = 5in /* width of graphs */ ); /* set local macro variables */ %local error tbl probfmt footer classname n1 n2 connect dsid med1 med2 vlist nvar; /* check input parameters */ %let error = 0; %if %sysfunc(exist(&data)) = 0 %then %do; %put ERROR: Data set &data does not exist ; %let error = 1; %if %length(&var) = 0 %then %do; %put ERROR: You must specify a list of dependent variables (VAR=) ; %let error = 1; %if %length(&class) = 0 %then %do; %put ERROR: You must specify a classification variable (CLASS=) ; %let error = 1; %if &error = 1 %then %goto finish ; /* apply listwise deletion of missing values */ data _mydata; set &data; if nmiss(of &var) then delete; if &class eq '' then delete; 16

17 /* get class variable label for table title */ data _null_; set _mydata; if vlabel(&class) ne "" then call symputx('classname', vlabel(&class)); else call symputx('classname', &class); stop; /* get sample sizes */ proc freq data=_mydata noprint; tables &class/out=_n ; data _null_ ; set _n; if _N_ eq 1 then call symputx('n1', count); else if _N_ eq 2 then call symputx('n2', count); /* wilcoxon mann whitney U test */ proc npar1way data = _mydata noprint wilcoxon; class &class; var &var; output out = _t1(keep = _var_ p2_wil _wil_) wilcoxon; /* calculate effect sizes */ data _t1; set _t1; ns = min(&n1, &n2); U = _WIL_ - (ns * (ns + 1))/2; A = (&n1 * &n2 - U) / (&n1 * &n2); odds = A / (1 - A); if A lt 0.5 then odds = 1/odds; drop _WIL_ ns U A; /* get median profiles */ proc means data = _mydata n median noprint; class &class; var &var; output out = _t2 median=; proc transpose data=_t2 out=_t2 name=_var_; id &class; data _t2; set _t2; _order_ = _N_; /* combine medians and p values */ proc sql; create table _t3 as select * from _t2 left join _t1 on _t1._var_ = _t2._var_ order _order_; quit; 17

18 data _t3; set _t3; if _var_ eq '_FREQ_' then _label_='(n)'; if _var_ eq '_TYPE_' then delete; if _label_ eq "" then _label_ = _var_; _label_ = trim(_label_); drop _var order_; /* customize output */ /* sort results by effect size */ %if %upcase(%substr(&order, 1, 1)) ^= D %then %do; proc sort data = _t3 out = _t3; by descending odds; /* replace probability values with stars? */ %if %upcase(%substr(&stars, 1, 1)) ^= N %then %do; proc format; value stars low = '****' < = '***' 0.001<-0.01 = '**' 0.01<-.05 = '*' other = ' '; %let probfmt = stars.; %let footer = %str(* p <.05, ** p < 0.1, *** p <.001, **** p <.0001) ; %else %do; %let probfmt = 5.3 ; %let footer = ; /* save current options so they can be restored later */ %let number = %sysfunc(getoption(number)); %let date = %sysfunc(getoption(date)); %let orientation = %sysfunc(getoption(orientation)); /* set new options */ options nodate nonumber orientation=&orientation; /* set RTF output destination */ ods listing close; ods rtf file = "&file" startpage = never style = Journal bodytitle; ods escapechar = '~' noptitle; ods graphics on / noborder height = &height width = &width; 18

19 /* create table */ %let dsid = %sysfunc(open(_t3, i)); %let med1 = %sysfunc(varname(&dsid, 2)); %let med2 = %sysfunc(varname(&dsid, 3)); proc report data=_t3 nowd split='_' style(report) = {just=left} style(header) = {font = ("times new roman", 10pt) just = right} style(column) = {font = ("times new roman", 10pt)}; col (_label_) ('Medians' &med1 &med2) ('Significance' P2_WIL odds); define _label_ / "Variable" style(header) = {just = left}; define P2_WIL / "p~{super 1}" format=&probfmt; define odds / "ES~{super 2}" format=4.2; format &med1 &med2 &medianfmt; compute after _page_/left; line "~S={font=('times new roman', 8pt) just=left} ~{super 1}Wilcoxon Test"; %if %upcase(%substr(&stars,1,1)) = Y %then %do; line "~S = {font = ('times new roman', 8pt) just = left}&footer"; line "~S = {font = ('times new roman', 8pt) just = left} ~{super 2}Probability-based effect size expressed as odds"; endcomp; /* add table title */ title "~S = {font = ('times new roman', 11pt) just = left}" "Table. Group Differences by &classname"; /* plot effect sizes */ %if %upcase(%substr(&effectsplot, 1, 1)) ^= N %then %do; proc sgplot data = _t3; dot _label_/ response = odds; label _label_ = "" odds = "Effect sizes (odds)"; where odds ne.; yaxis discreteorder = data; title "Effect Size Plot"; /* create comparative plots */ /* limit plots to significant effects */ data _t1a; set _t1; if P2_WIL lt α /* order plots by decreasing effect sizes */ %if %upcase(%substr(&order, 1, 1)) = E %then %do; proc sort data = _t1a out = _t1a; by descending odds; /* obtain dependent variable list */ data _NULL_; 19

20 set _t1a end = eof; length _vlist_ $ 200; retain _vlist_ ' '; retain nvar 0; nvar + 1; _vlist_ = trim(_vlist_) ' ' trim(_var_); if eof then do; call symput('vlist', trim(_vlist_)); call symput('nvar', put(nvar, 4.0)); end; /* generate histograms */ %if %upcase(%substr(&compareplot, 1, 1)) = H %then %do; %do i = 1 %to &nvar; %let dv = %scan(&vlist, &i, ' '); proc univariate data=_mydata noprint; class &class; histogram &dv / nrows = 2 intertile = 1 kernel(noprint); inset N Median MAD / pos = nw; title; /* generate box plots */ %if %upcase(%substr(&compareplot, 1, 1)) = B %then %do; %do i = 1 %to &nvar; %let dv = %scan(&vlist, &i, ' '); proc sgplot data=_mydata; hbox &dv / category = &class spread; xaxis grid; title; /* clean up */ proc datasets library = WORK nolist; delete _t1 _n _t2 _t3 _mydata; /* reset destination and options */ ods graphics off; ods rtf close; ods listing; /* restore options */ options &number &date orientation = &orientation; %finish: %mend WILCOXON; 20

Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research

Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research Liping Huang, Center for Home Care Policy and Research, Visiting Nurse Service of New York, NY, NY ABSTRACT The

More information

Presentation Quality Bulleted Lists Using ODS in SAS 9.2. Karl M. Kilgore, PhD, Cetus Group, LLC, Timonium, MD

Presentation Quality Bulleted Lists Using ODS in SAS 9.2. Karl M. Kilgore, PhD, Cetus Group, LLC, Timonium, MD Presentation Quality Bulleted Lists Using ODS in SAS 9.2 Karl M. Kilgore, PhD, Cetus Group, LLC, Timonium, MD ABSTRACT Business reports frequently include bulleted lists of items: summary conclusions from

More information

Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International

Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International Abstract Generating Customized Analytical Reports from SAS Procedure Output Brinda Bhaskar and Kennan Murray, RTI International SAS has many powerful features, including MACRO facilities, procedures such

More information

Paper S Data Presentation 101: An Analyst s Perspective

Paper S Data Presentation 101: An Analyst s Perspective Paper S1-12-2013 Data Presentation 101: An Analyst s Perspective Deanna Chyn, University of Michigan, Ann Arbor, MI Anca Tilea, University of Michigan, Ann Arbor, MI ABSTRACT You are done with the tedious

More information

Summary Table for Displaying Results of a Logistic Regression Analysis

Summary Table for Displaying Results of a Logistic Regression Analysis PharmaSUG 2018 - Paper EP-23 Summary Table for Displaying Results of a Logistic Regression Analysis Lori S. Parsons, ICON Clinical Research, Medical Affairs Statistical Analysis ABSTRACT When performing

More information

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA Thornton, S. P. (2006). Essential ODS techniques for creating reports in PDF. Paper presented at the Fourteenth Annual Western Users of the SAS Software Conference, Irvine, CA. Essential ODS Techniques

More information

ODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands

ODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands Paper CC01 ODS DOCUMENT, a practical example Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands ABSTRACT The ODS DOCUMENT destination (in short ODS DOCUMENT) is perhaps the most underutilized

More information

Table 1 in Scientific Manuscripts; Using PROC REPORT and the ODS System Carter Sevick, DoD Center for Deployment Health Research, San Diego, CA

Table 1 in Scientific Manuscripts; Using PROC REPORT and the ODS System Carter Sevick, DoD Center for Deployment Health Research, San Diego, CA Table 1 in Scientific Manuscripts; Using PROC REPORT and the ODS System Carter Sevick, DoD Center for Deployment Health Research, San Diego, CA ABSTRACT The ability to combine the power and flexibility

More information

Introduction to SAS/GRAPH Statistical Graphics Procedures

Introduction to SAS/GRAPH Statistical Graphics Procedures 3 CHAPTER 1 Introduction to SAS/GRAPH Statistical Graphics Procedures Overview of SAS/GRAPH Statistical Graphics Procedures 3 Introduction to the SGPLOT Procedure 4 Introduction to the SGPANEL Procedure

More information

ODS/RTF Pagination Revisit

ODS/RTF Pagination Revisit PharmaSUG 2018 - Paper QT-01 ODS/RTF Pagination Revisit Ya Huang, Halozyme Therapeutics, Inc. Bryan Callahan, Halozyme Therapeutics, Inc. ABSTRACT ODS/RTF combined with PROC REPORT has been used to generate

More information

A SAS MACRO for estimating bootstrapped confidence intervals in dyadic regression

A SAS MACRO for estimating bootstrapped confidence intervals in dyadic regression A SAS MACRO for estimating bootstrapped confidence intervals in dyadic regression models. Robert E. Wickham, Texas Institute for Measurement, Evaluation, and Statistics, University of Houston, TX ABSTRACT

More information

IT S THE LINES PER PAGE THAT COUNTS Jonathan Squire, C2RA, Cambridge, MA Johnny Tai, Comsys, Portage, MI

IT S THE LINES PER PAGE THAT COUNTS Jonathan Squire, C2RA, Cambridge, MA Johnny Tai, Comsys, Portage, MI IT S THE LINES PER PAGE THAT COUNTS Jonathan Squire, C2RA, Cambridge, MA Johnny Tai, Comsys, Portage, MI ABSTRACT When the bodytitle option is used to keep titles and footnotes independent of the table

More information

2.1 Objectives. Math Chapter 2. Chapter 2. Variable. Categorical Variable EXPLORING DATA WITH GRAPHS AND NUMERICAL SUMMARIES

2.1 Objectives. Math Chapter 2. Chapter 2. Variable. Categorical Variable EXPLORING DATA WITH GRAPHS AND NUMERICAL SUMMARIES EXPLORING DATA WITH GRAPHS AND NUMERICAL SUMMARIES Chapter 2 2.1 Objectives 2.1 What Are the Types of Data? www.managementscientist.org 1. Know the definitions of a. Variable b. Categorical versus quantitative

More information

Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint

Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint PharmaSUG 2018 - Paper DV-01 Square Peg, Square Hole Getting Tables to Fit on Slides in the ODS Destination for PowerPoint Jane Eslinger, SAS Institute Inc. ABSTRACT An output table is a square. A slide

More information

Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA

Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA SESUG 2012 Paper HW-01 Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA ABSTRACT Learning the basics of PROC REPORT can help the new SAS user avoid hours of headaches.

More information

Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS)

Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS) Paper 3327-2015 Automated Macros to Extract Data from the National (Nationwide) Inpatient Sample (NIS) Ravi Gaddameedi, California State University, Eastbay, CA; Usha Kreaden, Intuitive Surgical, Sunnyvale,

More information

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc. Abstract PharmaSUG 2011 - Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc. Adverse event (AE) analysis is a critical part

More information

Chapter Two: Descriptive Methods 1/50

Chapter Two: Descriptive Methods 1/50 Chapter Two: Descriptive Methods 1/50 2.1 Introduction 2/50 2.1 Introduction We previously said that descriptive statistics is made up of various techniques used to summarize the information contained

More information

SAS is the most widely installed analytical tool on mainframes. I don t know the situation for midrange and PCs. My Focus for SAS Tools Here

SAS is the most widely installed analytical tool on mainframes. I don t know the situation for midrange and PCs. My Focus for SAS Tools Here Explore, Analyze, and Summarize Your Data with SAS Software: Selecting the Best Power Tool from a Rich Portfolio PhD SAS is the most widely installed analytical tool on mainframes. I don t know the situation

More information

A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN

A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN Paper 045-29 A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN ABSTRACT: PROC MEANS analyzes datasets according to the variables listed in its Class

More information

My Reporting Requires a Full Staff Help!

My Reporting Requires a Full Staff Help! ABSTRACT Paper GH-03 My Reporting Requires a Full Staff Help! Erin Lynch, Daniel O Connor, Himesh Patel, SAS Institute Inc., Cary, NC With cost cutting and reduced staff, everyone is feeling the pressure

More information

AND NUMERICAL SUMMARIES. Chapter 2

AND NUMERICAL SUMMARIES. Chapter 2 EXPLORING DATA WITH GRAPHS AND NUMERICAL SUMMARIES Chapter 2 2.1 What Are the Types of Data? 2.1 Objectives www.managementscientist.org 1. Know the definitions of a. Variable b. Categorical versus quantitative

More information

Christopher Louden University of Texas Health Science Center at San Antonio

Christopher Louden University of Texas Health Science Center at San Antonio Christopher Louden University of Texas Health Science Center at San Antonio Overview of Macro Language Report Writing The REPORT procedure The Output Delivery System (ODS) Macro Examples Utility Macros

More information

An introduction to classification and regression trees with PROC HPSPLIT Peter L. Flom Peter Flom Consulting, LLC

An introduction to classification and regression trees with PROC HPSPLIT Peter L. Flom Peter Flom Consulting, LLC Paper AA-42 An introduction to classification and regression trees with PROC HPSPLIT Peter L. Flom Peter Flom Consulting, LLC ABSTRACT Classification and regression trees are extremely intuitive to read

More information

Excel 2010 with XLSTAT

Excel 2010 with XLSTAT Excel 2010 with XLSTAT J E N N I F E R LE W I S PR I E S T L E Y, PH.D. Introduction to Excel 2010 with XLSTAT The layout for Excel 2010 is slightly different from the layout for Excel 2007. However, with

More information

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes Brian E. Lawton Curriculum Research & Development Group University of Hawaii at Manoa Honolulu, HI December 2012 Copyright 2012

More information

Quick Results with the Output Delivery System

Quick Results with the Output Delivery System Paper 58-27 Quick Results with the Output Delivery System Sunil K. Gupta, Gupta Programming, Simi Valley, CA ABSTRACT SAS s new Output Delivery System (ODS) opens a whole new world of options in generating

More information

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA ABSTRACT Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA Data visualization is becoming a trend in all sectors where critical business decisions or assessments

More information

Macros for creating a custom report of figures

Macros for creating a custom report of figures ABSTRACT SESUG Paper AD-101-2017 Macros for creating a custom report of figures Laura Williams, CROS NT LLC Often, with clinical studies, a report that includes both tables and figures can be preferred.

More information

Analysis of Complex Survey Data with SAS

Analysis of Complex Survey Data with SAS ABSTRACT Analysis of Complex Survey Data with SAS Christine R. Wells, Ph.D., UCLA, Los Angeles, CA The differences between data collected via a complex sampling design and data collected via other methods

More information

A Macro to replace PROC REPORT!?

A Macro to replace PROC REPORT!? Paper TS03 A Macro to replace PROC REPORT!? Katja Glass, Bayer Pharma AG, Berlin, Germany ABSTRACT Some companies have macros for everything. But is that really required? Our company even has a macro to

More information

Run your reports through that last loop to standardize the presentation attributes

Run your reports through that last loop to standardize the presentation attributes PharmaSUG2011 - Paper TT14 Run your reports through that last loop to standardize the presentation attributes Niraj J. Pandya, Element Technologies Inc., NJ ABSTRACT Post Processing of the report could

More information

PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need

PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need ABSTRACT Paper PO 133 PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need Imelda C. Go, South Carolina Department of Education, Columbia,

More information

ABSTRACT INTRODUCTION TRICK 1: CHOOSE THE BEST METHOD TO CREATE MACRO VARIABLES

ABSTRACT INTRODUCTION TRICK 1: CHOOSE THE BEST METHOD TO CREATE MACRO VARIABLES An Efficient Method to Create a Large and Comprehensive Codebook Wen Song, ICF International, Calverton, MD Kamya Khanna, ICF International, Calverton, MD Baibai Chen, ICF International, Calverton, MD

More information

Introduction to Statistical Graphics Procedures

Introduction to Statistical Graphics Procedures Introduction to Statistical Graphics Procedures Selvaratnam Sridharma, U.S. Census Bureau, Washington, DC ABSTRACT SAS statistical graphics procedures (SG procedures) that were introduced in SAS 9.2 help

More information

Cluster Randomization Create Cluster Means Dataset

Cluster Randomization Create Cluster Means Dataset Chapter 270 Cluster Randomization Create Cluster Means Dataset Introduction A cluster randomization trial occurs when whole groups or clusters of individuals are treated together. Examples of such clusters

More information

Cut Out The Cut And Paste: SAS Macros For Presenting Statistical Output ABSTRACT INTRODUCTION

Cut Out The Cut And Paste: SAS Macros For Presenting Statistical Output ABSTRACT INTRODUCTION Cut Out The Cut And Paste: SAS Macros For Presenting Statistical Output Myungshin Oh, UCLA Department of Biostatistics Mel Widawski, UCLA School of Nursing ABSTRACT We, as statisticians, often spend more

More information

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One Using MACRO and SAS/GRAPH to Efficiently Assess Distributions Paul Walker, Capital One INTRODUCTION A common task in data analysis is assessing the distribution of variables by means of univariate statistics,

More information

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY PharmaSUG 2014 - Paper BB14 A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY ABSTRACT Clinical Study

More information

Using Templates Created by the SAS/STAT Procedures

Using Templates Created by the SAS/STAT Procedures Paper 081-29 Using Templates Created by the SAS/STAT Procedures Yanhong Huang, Ph.D. UMDNJ, Newark, NJ Jianming He, Solucient, LLC., Berkeley Heights, NJ ABSTRACT SAS procedures provide a large quantity

More information

PharmaSUG Paper SP07

PharmaSUG Paper SP07 PharmaSUG 2014 - Paper SP07 ABSTRACT A SAS Macro to Evaluate Balance after Propensity Score ing Erin Hulbert, Optum Life Sciences, Eden Prairie, MN Lee Brekke, Optum Life Sciences, Eden Prairie, MN Propensity

More information

Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA

Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA Using PROC REPORT to Cross-Tabulate Multiple Response Items Patrick Thornton, SRI International, Menlo Park, CA ABSTRACT This paper describes for an intermediate SAS user the use of PROC REPORT to create

More information

The basic arrangement of numeric data is called an ARRAY. Array is the derived data from fundamental data Example :- To store marks of 50 student

The basic arrangement of numeric data is called an ARRAY. Array is the derived data from fundamental data Example :- To store marks of 50 student Organizing data Learning Outcome 1. make an array 2. divide the array into class intervals 3. describe the characteristics of a table 4. construct a frequency distribution table 5. constructing a composite

More information

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System) SAS (Statistical Analysis Software/System) SAS Analytics:- Class Room: Training Fee & Duration : 23K & 3 Months Online: Training Fee & Duration : 25K & 3 Months Learning SAS: Getting Started with SAS Basic

More information

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System) SAS (Statistical Analysis Software/System) Clinical SAS:- Class Room: Training Fee & Duration : 23K & 3 Months Online: Training Fee & Duration : 25K & 3 Months Learning SAS: Getting Started with SAS Basic

More information

186 Statistics, Data Analysis and Modeling. Proceedings of MWSUG '95

186 Statistics, Data Analysis and Modeling. Proceedings of MWSUG '95 A Statistical Analysis Macro Library in SAS Carl R. Haske, Ph.D., STATPROBE, nc., Ann Arbor, M Vivienne Ward, M.S., STATPROBE, nc., Ann Arbor, M ABSTRACT Statistical analysis plays a major role in pharmaceutical

More information

Ranking Between the Lines

Ranking Between the Lines Ranking Between the Lines A %MACRO for Interpolated Medians By Joe Lorenz SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in

More information

Data Quality Review for Missing Values and Outliers

Data Quality Review for Missing Values and Outliers Paper number: PH03 Data Quality Review for Missing Values and Outliers Ying Guo, i3, Indianapolis, IN Bradford J. Danner, i3, Lincoln, NE ABSTRACT Before performing any analysis on a dataset, it is often

More information

Formatting Highly Detailed Reports: Eye-Friendly, Insight-Facilitating

Formatting Highly Detailed Reports: Eye-Friendly, Insight-Facilitating L.Fine Formatting Highly Detailed Reports 1 Formatting Highly Detailed Reports: Eye-Friendly, Insight-Facilitating Lisa Fine, United BioSource Corporation Introduction Consider a highly detailed report

More information

Choosing the Right Procedure

Choosing the Right Procedure 3 CHAPTER 1 Choosing the Right Procedure Functional Categories of Base SAS Procedures 3 Report Writing 3 Statistics 3 Utilities 4 Report-Writing Procedures 4 Statistical Procedures 5 Efficiency Issues

More information

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility PharmaSUG2011 Paper TT12 Creating Forest Plots Using SAS/GRAPH and the Annotate Facility Amanda Tweed, Millennium: The Takeda Oncology Company, Cambridge, MA ABSTRACT Forest plots have become common in

More information

Streamline Table Lookup by Embedding HASH in FCMP Qing Liu, Eli Lilly & Company, Shanghai, China

Streamline Table Lookup by Embedding HASH in FCMP Qing Liu, Eli Lilly & Company, Shanghai, China ABSTRACT PharmaSUG China 2017 - Paper 19 Streamline Table Lookup by Embedding HASH in FCMP Qing Liu, Eli Lilly & Company, Shanghai, China SAS provides many methods to perform a table lookup like Merge

More information

Data Analysis and Solver Plugins for KSpread USER S MANUAL. Tomasz Maliszewski

Data Analysis and Solver Plugins for KSpread USER S MANUAL. Tomasz Maliszewski Data Analysis and Solver Plugins for KSpread USER S MANUAL Tomasz Maliszewski tmaliszewski@wp.pl Table of Content CHAPTER 1: INTRODUCTION... 3 1.1. ABOUT DATA ANALYSIS PLUGIN... 3 1.3. ABOUT SOLVER PLUGIN...

More information

A Macro to Keep Titles and Footnotes in One Place

A Macro to Keep Titles and Footnotes in One Place CC25 ABSTRACT A Macro to Keep Titles and Footnotes in One Place John Morrill, Quintiles, Inc., Kansas City, MO A large project with titles and footnotes in each separate program can be cumbersome to maintain.

More information

Uncommon Techniques for Common Variables

Uncommon Techniques for Common Variables Paper 11863-2016 Uncommon Techniques for Common Variables Christopher J. Bost, MDRC, New York, NY ABSTRACT If a variable occurs in more than one data set being merged, the last value (from the variable

More information

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Paper TT13 So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Anthony Harris, PPD, Wilmington, NC Robby Diseker, PPD, Wilmington, NC ABSTRACT

More information

Two useful macros to nudge SAS to serve you

Two useful macros to nudge SAS to serve you Two useful macros to nudge SAS to serve you David Izrael, Michael P. Battaglia, Abt Associates Inc., Cambridge, MA Abstract This paper offers two macros that augment the power of two SAS procedures: LOGISTIC

More information

EXST SAS Lab Lab #8: More data step and t-tests

EXST SAS Lab Lab #8: More data step and t-tests EXST SAS Lab Lab #8: More data step and t-tests Objectives 1. Input a text file in column input 2. Output two data files from a single input 3. Modify datasets with a KEEP statement or option 4. Prepare

More information

Lab 3 (80 pts.) - Assessing the Normality of Data Objectives: Creating and Interpreting Normal Quantile Plots

Lab 3 (80 pts.) - Assessing the Normality of Data Objectives: Creating and Interpreting Normal Quantile Plots STAT 350 (Spring 2015) Lab 3: SAS Solutions 1 Lab 3 (80 pts.) - Assessing the Normality of Data Objectives: Creating and Interpreting Normal Quantile Plots Note: The data sets are not included in the solutions;

More information

Math 120 Introduction to Statistics Mr. Toner s Lecture Notes 3.1 Measures of Central Tendency

Math 120 Introduction to Statistics Mr. Toner s Lecture Notes 3.1 Measures of Central Tendency Math 1 Introduction to Statistics Mr. Toner s Lecture Notes 3.1 Measures of Central Tendency lowest value + highest value midrange The word average: is very ambiguous and can actually refer to the mean,

More information

Contents of SAS Programming Techniques

Contents of SAS Programming Techniques Contents of SAS Programming Techniques Chapter 1 About SAS 1.1 Introduction 1.1.1 SAS modules 1.1.2 SAS module classification 1.1.3 SAS features 1.1.4 Three levels of SAS techniques 1.1.5 Chapter goal

More information

ODS for PRINT, REPORT and TABULATE

ODS for PRINT, REPORT and TABULATE ODS for PRINT, REPORT and TABULATE Lauren Haworth, Genentech, Inc., San Francisco ABSTRACT For most procedures in the SAS system, the only way to change the appearance of the output is to change or modify

More information

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr ABSTRACT A strategy for understanding your data: Binary Flags and PROC MEANS Glen Masuda, SRI International, Menlo Park, CA Tejaswini Tiruke, SRI International, Menlo Park, CA Many times projects have

More information

SAS Graphs in Small Multiples Andrea Wainwright-Zimmerman, Capital One, Richmond, VA

SAS Graphs in Small Multiples Andrea Wainwright-Zimmerman, Capital One, Richmond, VA Paper SIB-113 SAS Graphs in Small Multiples Andrea Wainwright-Zimmerman, Capital One, Richmond, VA ABSTRACT Edward Tufte has championed the idea of using "small multiples" as an effective way to present

More information

PROC REPORT Basics: Getting Started with the Primary Statements

PROC REPORT Basics: Getting Started with the Primary Statements Paper HOW07 PROC REPORT Basics: Getting Started with the Primary Statements Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT The presentation of data is an essential

More information

Using SAS to Analyze CYP-C Data: Introduction to Procedures. Overview

Using SAS to Analyze CYP-C Data: Introduction to Procedures. Overview Using SAS to Analyze CYP-C Data: Introduction to Procedures CYP-C Research Champion Webinar July 14, 2017 Jason D. Pole, PhD Overview SAS overview revisited Introduction to SAS Procedures PROC FREQ PROC

More information

Are You Missing Out? Working with Missing Values to Make the Most of What is not There

Are You Missing Out? Working with Missing Values to Make the Most of What is not There Are You Missing Out? Working with Missing Values to Make the Most of What is not There Arthur L. Carpenter, California Occidental Consultants ABSTRACT Everyone uses and works with missing values, however

More information

Indenting with Style

Indenting with Style ABSTRACT Indenting with Style Bill Coar, Axio Research, Seattle, WA Within the pharmaceutical industry, many SAS programmers rely heavily on Proc Report. While it is used extensively for summary tables

More information

Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies

Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies Gandhi R Bhattarai PhD, OptumInsight, Rocky Hill, CT ABSTRACT Measuring the change in outcomes between

More information

Prepare a stem-and-leaf graph for the following data. In your final display, you should arrange the leaves for each stem in increasing order.

Prepare a stem-and-leaf graph for the following data. In your final display, you should arrange the leaves for each stem in increasing order. Chapter 2 2.1 Descriptive Statistics A stem-and-leaf graph, also called a stemplot, allows for a nice overview of quantitative data without losing information on individual observations. It can be a good

More information

Part 1. Getting Started. Chapter 1 Creating a Simple Report 3. Chapter 2 PROC REPORT: An Introduction 13. Chapter 3 Creating Breaks 57

Part 1. Getting Started. Chapter 1 Creating a Simple Report 3. Chapter 2 PROC REPORT: An Introduction 13. Chapter 3 Creating Breaks 57 Part 1 Getting Started Chapter 1 Creating a Simple Report 3 Chapter 2 PROC REPORT: An Introduction 13 Chapter 3 Creating Breaks 57 Chapter 4 Only in the LISTING Destination 75 Chapter 5 Creating and Modifying

More information

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

Displaying Multiple Graphs to Quickly Assess Patient Data Trends Paper AD11 Displaying Multiple Graphs to Quickly Assess Patient Data Trends Hui Ping Chen and Eugene Johnson, Eli Lilly and Company, Indianapolis, IN ABSTRACT Populating multiple graphs, up to 15, on a

More information

PharmaSUG China 2018 Paper AD-62

PharmaSUG China 2018 Paper AD-62 PharmaSUG China 2018 Paper AD-62 Decomposition and Reconstruction of TLF Shells - A Simple, Fast and Accurate Shell Designer Chengeng Tian, dmed Biopharmaceutical Co., Ltd., Shanghai, China ABSTRACT Table/graph

More information

Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975.

Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975. Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975. SPSS Statistics were designed INTRODUCTION TO SPSS Objective About the

More information

Lab 1: Introduction to Data

Lab 1: Introduction to Data 1 Lab 1: Introduction to Data Some define Statistics as the field that focuses on turning information into knowledge. The first step in that process is to summarize and describe the raw information the

More information

Using PROC SQL to Generate Shift Tables More Efficiently

Using PROC SQL to Generate Shift Tables More Efficiently ABSTRACT SESUG Paper 218-2018 Using PROC SQL to Generate Shift Tables More Efficiently Jenna Cody, IQVIA Shift tables display the change in the frequency of subjects across specified categories from baseline

More information

Data Analyst Nanodegree Syllabus

Data Analyst Nanodegree Syllabus Data Analyst Nanodegree Syllabus Discover Insights from Data with Python, R, SQL, and Tableau Before You Start Prerequisites : In order to succeed in this program, we recommend having experience working

More information

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System) SAS (Statistical Analysis Software/System) SAS Adv. Analytics or Predictive Modelling:- Class Room: Training Fee & Duration : 30K & 3 Months Online Training Fee & Duration : 33K & 3 Months Learning SAS:

More information

Macros and ODS. SAS Programming November 6, / 89

Macros and ODS. SAS Programming November 6, / 89 Macros and ODS The first part of these slides overlaps with last week a fair bit, but it doesn t hurt to review as this code might be a little harder to follow. SAS Programming November 6, 2014 1 / 89

More information

CHAPTER 6. The Normal Probability Distribution

CHAPTER 6. The Normal Probability Distribution The Normal Probability Distribution CHAPTER 6 The normal probability distribution is the most widely used distribution in statistics as many statistical procedures are built around it. The central limit

More information

Clinical Data Visualization using TIBCO Spotfire and SAS

Clinical Data Visualization using TIBCO Spotfire and SAS ABSTRACT SESUG Paper RIV107-2017 Clinical Data Visualization using TIBCO Spotfire and SAS Ajay Gupta, PPD, Morrisville, USA In Pharmaceuticals/CRO industries, you may receive requests from stakeholders

More information

Manipulating Statistical and Other Procedure Output to Get the Results That You Need

Manipulating Statistical and Other Procedure Output to Get the Results That You Need Paper SAS1798-2018 Manipulating Statistical and Other Procedure Output to Get the Results That You Need Vincent DelGobbo, SAS Institute Inc. ABSTRACT Many scientific and academic journals require that

More information

Introduction (SPSS) Opening SPSS Start All Programs SPSS Inc SPSS 21. SPSS Menus

Introduction (SPSS) Opening SPSS Start All Programs SPSS Inc SPSS 21. SPSS Menus Introduction (SPSS) SPSS is the acronym of Statistical Package for the Social Sciences. SPSS is one of the most popular statistical packages which can perform highly complex data manipulation and analysis

More information

A Lazy Programmer s Macro for Descriptive Statistics Tables

A Lazy Programmer s Macro for Descriptive Statistics Tables Paper SA19-2011 A Lazy Programmer s Macro for Descriptive Statistics Tables Matthew C. Fenchel, M.S., Cincinnati Children s Hospital Medical Center, Cincinnati, OH Gary L. McPhail, M.D., Cincinnati Children

More information

It s Proc Tabulate Jim, but not as we know it!

It s Proc Tabulate Jim, but not as we know it! Paper SS02 It s Proc Tabulate Jim, but not as we know it! Robert Walls, PPD, Bellshill, UK ABSTRACT PROC TABULATE has received a very bad press in the last few years. Most SAS Users have come to look on

More information

Creating Macro Calls using Proc Freq

Creating Macro Calls using Proc Freq Creating Macro Calls using Proc Freq, Educational Testing Service, Princeton, NJ ABSTRACT Imagine you were asked to get a series of statistics/tables for each country in the world. You have the data, but

More information

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data Paper PO31 The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data MaryAnne DePesquo Hope, Health Services Advisory Group, Phoenix, Arizona Fen Fen Li, Health Services Advisory Group,

More information

PharmaSUG China. Systematically Reordering Axis Major Tick Values in SAS Graph Brian Shen, PPDI, ShangHai

PharmaSUG China. Systematically Reordering Axis Major Tick Values in SAS Graph Brian Shen, PPDI, ShangHai PharmaSUG China Systematically Reordering Axis Major Tick Values in SAS Graph Brian Shen, PPDI, ShangHai ABSTRACT Once generating SAS graphs, it is a headache to programmers to reorder the axis tick values

More information

SESUG Paper RIV An Obvious Yet Helpful Guide to Developing Recurring Reports in SAS. Rachel Straney, University of Central Florida

SESUG Paper RIV An Obvious Yet Helpful Guide to Developing Recurring Reports in SAS. Rachel Straney, University of Central Florida SESUG Paper RIV-156-2017 An Obvious Yet Helpful Guide to Developing Recurring Reports in SAS Rachel Straney, University of Central Florida ABSTRACT Analysts, in particular SAS programmers, are often tasked

More information

Know What You Are Missing: How to Catalogue and Manage Missing Pieces of Historical Data

Know What You Are Missing: How to Catalogue and Manage Missing Pieces of Historical Data Know What You Are Missing: How to Catalogue and Manage Missing Pieces of Historical Data Shankar Yaddanapudi, SAS Consultant, Washington DC ABSTRACT In certain applications it is necessary to maintain

More information

Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL

Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL Paper TS05-2011 Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL Abstract SQL was developed to pull together information from several different data tables - use this to your advantage as you

More information

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment

A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment A Practical and Efficient Approach in Generating AE (Adverse Events) Tables within a Clinical Study Environment Abstract Jiannan Hu Vertex Pharmaceuticals, Inc. When a clinical trial is at the stage of

More information

Basic concepts and terms

Basic concepts and terms CHAPTER ONE Basic concepts and terms I. Key concepts Test usefulness Reliability Construct validity Authenticity Interactiveness Impact Practicality Assessment Measurement Test Evaluation Grading/marking

More information

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic.

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic. Automating the process of choosing among highly correlated covariates for multivariable logistic regression Michael C. Doherty, i3drugsafety, Waltham, MA ABSTRACT In observational studies, there can be

More information

ABSTRACT INTRODUCTION MACRO. Paper RF

ABSTRACT INTRODUCTION MACRO. Paper RF Paper RF-08-2014 Burst Reporting With the Help of PROC SQL Dan Sturgeon, Priority Health, Grand Rapids, Michigan Erica Goodrich, Priority Health, Grand Rapids, Michigan ABSTRACT Many SAS programmers need

More information

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions Introduction to SAS Procedures SAS Basics III Susan J. Slaughter, Avocet Solutions SAS Essentials Section for people new to SAS Core presentations 1. How SAS Thinks 2. Introduction to DATA Step Programming

More information

footnote1 height=8pt j=l "(Rev. &sysdate)" j=c "{\b\ Page}{\field{\*\fldinst {\b\i PAGE}}}";

footnote1 height=8pt j=l (Rev. &sysdate) j=c {\b\ Page}{\field{\*\fldinst {\b\i PAGE}}}; Producing an Automated Data Dictionary as an RTF File (or a Topic to Bring Up at a Party If You Want to Be Left Alone) Cyndi Williamson, SRI International, Menlo Park, CA ABSTRACT Data dictionaries are

More information

Chapter 2. Descriptive Statistics: Organizing, Displaying and Summarizing Data

Chapter 2. Descriptive Statistics: Organizing, Displaying and Summarizing Data Chapter 2 Descriptive Statistics: Organizing, Displaying and Summarizing Data Objectives Student should be able to Organize data Tabulate data into frequency/relative frequency tables Display data graphically

More information

SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG

SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG Paper SD10 A SAS MACRO FOR PERFORMING BACKWARD SELECTION IN PROC SURVEYREG Qixuan Chen, University of Michigan, Ann Arbor, MI Brenda Gillespie, University of Michigan, Ann Arbor, MI ABSTRACT This paper

More information

QUERIES BY ODS BEGINNERS. Varsha C. Shah, Dept. of Biostatistics, UNC-CH, Chapel Hill, NC

QUERIES BY ODS BEGINNERS. Varsha C. Shah, Dept. of Biostatistics, UNC-CH, Chapel Hill, NC QUERIES BY ODS BEGINNERS Varsha C. Shah, Dept. of Biostatistics, UNC-CH, Chapel Hill, NC ABSTRACT This paper presents a list of questions often asked by those initially experimenting with ODS output. Why

More information