You might (and should) question why I am using the macros in such a strange fashion. The answer being that the macros were designed to do all the complicated work for you and were designed to handle many situations. The idea is that if you use the macros for creating tables then the work you have to do is mostly in selecting the data and feeding it to the macros and displaying the results afterwards (if the macro can not do it). Tables should just be tabulations. And by "tabulations" it means that you should not be doing any processing work. You should just select the data, feed it into the macro, and if it can not display the results you want then you do so using "proc report" on the output dataset but at no time do you do any "real processing" of the data because that would need "validation" and the Spectre macros should be "validated" already and able to do the work for you without any worries. They have been in use since 2006 and have never been known to produce a wrong value (except in the case of sparse p-value statistics that got fixed a few years ago). You can rely on them completely and they can do a few things for you like transpose the results any way you wish. You are going to see a complex example that I will explain.
________________________________________________________________________________________________________________________________________________________ Treatment/ ______________________Value at Visit______________________ _________________Difference from baseline_________________ Visit N* Mean SD Min Median Max N* Mean SD Min Median Max ________________________________________________________________________________________________________________________________________________________ |
/**************************
Summarize **************************/ %let wherecls=and _hasbase=1 and _haslast=1;
%unistats(dsin=_laball3(where=((_fgprev or _fgontv or _fgpostv)
&wherecls and missing(_fgrept))),
/**************************
*- add in the lab group info -;
|
The list of numeric statistics variables will be the list of "keywords"
held in &_statkeys_ and the corresponding character variables
will have the same name but ending in "1STR" or "2STR". A little later
in the code I list these character variables that I need to use in a "proc
report" step. Look carefully at the way I refer to them. Look for %suffix(1STR,&_statkeys_)
and %scan(&_statkeys_,&i,%str( ))&j.STR
/**************************
Produce report **************************/ %let ncolw=8;
proc report missing headline headskip nowd split="@" data=_transtat2
spacing=2;
|
Use the "Back" button of your browser to return to the previous page.
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.