Escolar Documentos
Profissional Documentos
Cultura Documentos
Miscellaneous Topics
More SGPLOT examples
Exporting data
Macro variables
Table Generation - PROC TABULATE
LSB: 4:13-17; 7:1-8; 10:1-6
trt
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
month
0
1
2
3
6
9
12
15
18
21
24
27
30
33
36
0
1
2
3
6
9
12
15
18
21
24
27
30
33
36
cd4
102
177
192
195
217
232
252
270
287
305
323
337
343
360
376
102
184
194
202
223
249
273
299
323
339
363
386
392
394
418
* Exporting Data;
LIBNAME mylib C:\SAS_Files;
DATA temp;
SET mylib.sescore;
KEEP ptid clinic randdate group educ
wt12 sbp12 sescr12;
RUN;
A00083,A,02/05/1987,2,7,125,113,1.05
A00301,A,02/17/1987,6,9,,,1.15
A00312,A,04/08/1987,3,4,131,113,1.15
This data can easily be put into excel by
clicking on the file and then saving the file
as a worksheet.
TABLE GENERATION
Average Blood Pressure by Treatment at 12-Months
G
R
O
U
P
A
L
L
Diastolic BP
Systolic BP
N
Mean
N
Mean
Rx Group
Beta Blocker
15
77.8
15
120.2
CCB
17
81.7
17
124.1
Diuretic
14
78.1
14
117.4
Alpha Blocker
14
77.7
14
127.6
Ace Inhibitor
13
79.6
13
123.2
Placebo
19
79.6
19
129.9
Total
92
79.2
92
124.0
C
L
I
N
I
C
A
L
L
Men
Women
N
Percent
N
Percent
Clinical
Center
Birmingham
12
66.7
6
33.3
Chicago
20
69.0
9
31.0
Minneapolis
30
83.3
6
16.7
Pittsburgh
11
64.7
6
35.3
Total
73
73.0
27
27.0
Macro Variables
%let macrovarname = characters ;
dbpbl;
sbpbl;
- cholbl;
- glucbl;
data temp;
set temp;
%change(12);
%change(24);
%change(36);
run;
dbpbl;
sbpbl;
- cholbl;
- glucbl;
dbpbl;
sbpbl;
- cholbl;
- glucbl;
dbpbl;
sbpbl;
- cholbl;
- glucbl;
SAS substitutes
the value of v
everywhere there
is an &v