Examples of Statistical Procedures Using SAS

advertisement
Examples of Statistical Procedures
Using SAS
(commands=statistics.sas)
Afifi Data
Afifi and Azen (1972) describe data collected at the Los Angeles Shock Unit, which are used for
this example. There are two lines of raw data for each person in the study. The codebook for the
raw data layout is shown below:
Variables
1,22
2,23
3,24
4,25
5,26
6,27
Columns
1-4
5-8
9-12
13-15
16
17-20
Format
4.0
4.0
4.0
3.0
1.0
4.0
7,28
8,29
9,30
10,31
11,32
12,33
13,34
14,35
15,36
16,37
17,38
18,39
19,40
20,41
21,42
21-24
25-28
29-32
33-36
37-40
41-44
45-48
49-52
53-56
57-60
61-64
65-68
69-72
73-76
80
4.0
4.0
4.0
4.0
4.1
4.2
4.2
4.1
4.1
4.0
4.1
4.1
4.1
4.1
1.0
Description
Id number
Age (years)
Height (cm)
Sex (1=male, 2=female)
Survival (1=lived, 3=died)
Shock type (2=non-shock,
3=hypovolemic shock,
4=cardiogenic shock,
5=bacterial shock,
6=neurogenic shock,
7=other)
Systolic Blood Pressure (mm Hg)
Mean Arterial Pressure (mm Hg)
Heartrate (beats per minute)
Diastolic blood pressure (mm Hg)
Mean central venous BP (mm Hg)
Body surface area (m sq)
Cardiac index (1/min/min squared)
Appearance time (sec)
Mean circulation time (sec)
Urinary Output (ml/hr)
Plasma volume index (ml/kg)
Red cell index (ml/kg)
Hemoglobin (gm)
Hematocrit (%)
Card (1=initial, 2=final)
A listing of the first 6 lines of the raw data file, afifi.dat, is shown below:
340
340
412
412
426
426
70
70
56
56
47
47
160
160
173
173
176
176
23
23
11
11
11
11
4 62
4 129
4 83
4 102
4 80
4 87
38 53
74 72
66 110
75 108
64 84
68 77
29 100 187 90 190 390
0 394 241
53 190 187 120 130 300 15 394 241
60 10 182 126 221 407 110 362 240
63 90 182 281 100 206 50 564 266
55 10 180 110 120 280 80 373 272
52 40 180 410 100 170 75 508 217
131
112
166
154
146
99
400
365
500
330
490
320
1
2
1
2
1
2
SAS commands to read in selected variables from afifi.dat are shown below. These commands
read in two lines of data for each case. Note: these commands must be modified if you wish to
read in all the variables from the raw data.
DATA AFIFI;
INFILE "AFIFI.DAT";
INPUT
#1 IDNUM 1-4 AGE 5-8 SEX 13-15 SURVIVE 16 SHOKTYPE 17-20 SBP1 21-24
MAP1 25-28 HEART1 29-32 CARDIAC1 45-48 2 URINE1 57-60 HGB1 69-72 1
#2 SBP2 21-24 MAP2 25-28 HEART2 29-32 CARDIAC2 45-48 2 URINE2 57-60
HGB2 69-72 1;
LABEL SHOCK="Shock type"
SBP1="Systolic BP at time 1"
SBP2="Systolic BP at time 2"
MAP1="Mean arterial pressure at time 1"
MAP2="Mean arterial pressure at time 2"
HEART1="Heart rate at time 1"
HEART2="Heart rate at time 2"
CARDIAC1="Cardiac index at time 1"
CARDIAC2="Cardiac index at time 2"
URINE1="Urinary output at time 1"
URINE2="Urinary output at time 2"
HGB1="Hemoglobin at time 1"
HGB2="Hemoglobin at time 2" ;
IF SHOKTYPE=2 THEN SHOCK=1;
IF SHOKTYPE IN (3,4,5,6,7) THEN SHOCK=2;
IF SURVIVE=1 THEN DIED=0;
IF SURVIVE=3 THEN DIED=1;
SBPDIFF=SBP2-SBP1;
LABEL SHOCK="Binary Shock";
RUN;
PROC FORMAT;
VALUE SEXFMT
1="1: Male" 2="2: Female" ;
VALUE SURVFMT 1="1: Lived" 3="3: Died" ;
VALUE SHKTYFMT 2="2: Non-Shock"
3="3: Hypovolemic"
4="4: Cardiogenic"
5="5: Bacterial"
6="6: Neurogenic"
7="7: Other";
VALUE SHOCKFMT 1="1: No shock" 2="2: Shock" ;
RUN;
PROC DATASETS LIB=WORK;
MODIFY AFIFI;
FORMAT SEX SEXFMT. SURVIVE SURVFMT.
SHOKTYPE SHKTYFMT. SHOCK SHOCKFMT.;
RUN;
PROC CONTENTS DATA=AFIFI VARNUM;
RUN;
OPTIONS _LAST_=AFIFI;
TITLE "DESCRIPTIVE STATISTICS";
PROC MEANS;
RUN;
TITLE "FREQUENCY TABLES FOR SELECTED VARIABLES";
PROC FREQ;
TABLES SEX SURVIVE SEX SHOKTYPE SHOCK ;
RUN;
TITLE "CROSS TABULATIONS FOR SURVIVAL AND SHOCK TYPE";
PROC FREQ;
TABLES SHOCK*SURVIVE/CHISQ EXPECTED RELRISK;
RUN;
TITLE "HISTOGRAMS";
PROC UNIVARIATE;
ID IDNUM;
VAR SBP1 URINE1 ;
HISTOGRAM;
RUN;
TITLE "INDEPENDENT SAMPLES T-TEST FOR SELECTED VARIABLES";
PROC TTEST;
CLASS SURVIVE ;
VAR SBP1 HEART1 CARDIAC1 MAP1;
RUN;
TITLE "PAIRED T-TEST FOR SBP1 VS. SBP2";
PROC TTEST;
PAIRED SBP2*SBP1;
RUN;
PROC SORT;
BY SURVIVE;
RUN;
TITLE "PAIRED T-TEST FOR SBP1 VS. SBP2";
TITLE2 "SEPARATELY FOR THOSE WHO SURVIVED AND THOSE WHO DIED";
PROC TTEST;
BY SURVIVE;
PAIRED SBP2*SBP1;
RUN;
TITLE "CORRELATIONS";
PROC CORR NOMISS;
VAR SBP2 CARDIAC1 HEART1 HGB1 MAP1 ;
FOOTNOTE ;
RUN;
ODS GRAPHICS ON;
TITLE "REGRESSION ANALYSIS WITH DIAGNOSTIC PLOTS";
TITLE2 "AND ANALYSIS OF RESIDUALS";
PROC REG DATA=AFIFI;
MODEL SBP2= CARDIAC1 HEART1 HGB1 URINE1 MAP1 / PARTIAL;
OUTPUT OUT=REGDAT P=PREDICT R=RESID;
RUN;QUIT;
ODS GRAPHICS OFF;
TITLE "CHECK NORMALITY OF RESIDUALS";
PROC UNIVARIATE;
VAR RESID;
HISTOGRAM;
QQPLOT / NORMAL(MU=EST SIGMA=EST);
RUN;
TITLE "ONEWAY ANALYSIS OF VARIANCE";
TITLE2 "WITH TUKEY MULTIPLE COMPARISON METHOD";
PROC GLM;
CLASS SHOKTYPE;
MODEL SBP1=SHOKTYPE;
LSMEANS SHOKTYPE/ ADJUST=TUKEY ;
RUN;QUIT;
TITLE "LOGISTIC REGRESSION";
PROC LOGISTIC DESCENDING;
CLASS SHOKTYPE / PARAM=REF REF=FIRST;
MODEL DIED = SHOKTYPE SBP1 CARDIAC1/ RSQUARE LACKFIT;
UNITS SBP1=1 10;
RUN;
The output from the above commands is shown on the following pages:
PROC CONTENTS DATA=AFIFI VARNUM;
RUN;
The CONTENTS Procedure
Data Set Name
Member Type
Engine
Created
Last Modified
Protection
Data Set Type
Label
Data Representation
Encoding
WORK.AFIFI
DATA
V9
Friday, July 20, 2012 07:28:57 AM
Friday, July 20, 2012 07:28:57 AM
Observations
Variables
Indexes
Observation Length
Deleted Observations
Compressed
Sorted
113
20
0
160
0
NO
NO
WINDOWS_32
wlatin1 Western (Windows)
Engine/Host Dependent Information
Data Set Page Size
Number of Data Set Pages
First Data Page
Max Obs per Page
Obs in First Data Page
Number of Data Set Repairs
Filename
Release Created
Host Created
16384
3
1
102
82
0
C:\Users\kwelch\AppData\Local\Temp\SAS
Temporary Files\_TD4412\afifi.sas7bdat
9.0202M2
W32_VSPRO
Variables in Creation Order
#
Variable
Type
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
IDNUM
AGE
SEX
SURVIVE
SHOKTYPE
SBP1
MAP1
HEART1
CARDIAC1
URINE1
HGB1
SBP2
MAP2
HEART2
CARDIAC2
URINE2
HGB2
SHOCK
DIED
SBPDIFF
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Num
Len
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
Format
Label
SEXFMT.
SURVFMT.
SHKTYFMT.
SHOCKFMT.
Systolic BP at time 1
Mean arterial pressure at time 1
Heart rate at time 1
Cardiac index at time 1
Urinary output at time 1
Hemoglobin at time 1
Systolic BP at time 2
Mean arterial pressure at time 2
Heart rate at time 2
Cardiac index at time 2
Urinary output at time 2
Hemoglobin at time 2
Binary Shock
TITLE "DESCRIPTIVE STATISTICS";
PROC MEANS;
RUN;
DESCRIPTIVE STATISTICS
The MEANS Procedure
Variable
Label
N
Mean
Std Dev
Minimum
---------------------------------------------------------------------------------------------IDNUM
113
635.6991150
82.9653418
340.0000000
AGE
113
54.6283186
16.5966836
16.0000000
SEX
113
1.4778761
0.5017353
1.0000000
SURVIVE
113
1.7610619
0.9753602
1.0000000
SHOKTYPE
113
3.9380531
1.6970730
2.0000000
SBP1
Systolic BP at time 1
111
105.8558559
30.7691838
26.0000000
MAP1
Mean arterial pressure at time 1
113
73.4247788
22.0039791
15.0000000
HEART1
Heart rate at time 1
113
104.4424779
29.6093428
25.0000000
CARDIAC1
Cardiac index at time 1
110
2.5704545
1.4828335
0.1700000
URINE1
Urinary output at time 1
113
54.4336283
112.3486185
0
HGB1
Hemoglobin at time 1
113
11.4362832
2.5388785
6.6000000
SBP2
Systolic BP at time 2
113
110.7876106
37.0102426
38.0000000
MAP2
Mean arterial pressure at time 2
113
73.2123894
27.0826946
22.0000000
HEART2
Heart rate at time 2
113
96.3893805
29.6480647
25.0000000
CARDIAC2
Cardiac index at time 2
113
2.9354867
1.3358103
0.6600000
URINE2
Urinary output at time 2
113
77.5221239
135.9852997
0
HGB2
Hemoglobin at time 2
113
10.5345133
2.0166171
5.9000000
SHOCK
Binary Shock
113
1.6991150
0.4606857
1.0000000
DIED
113
0.3805310
0.4876801
0
SBPDIFF
111
4.4414414
35.6545763
-67.0000000
---------------------------------------------------------------------------------------------Variable
Label
Maximum
---------------------------------------------------------IDNUM
758.0000000
AGE
90.0000000
SEX
2.0000000
SURVIVE
3.0000000
SHOKTYPE
7.0000000
SBP1
Systolic BP at time 1
171.0000000
MAP1
Mean arterial pressure at time 1
124.0000000
HEART1
Heart rate at time 1
217.0000000
CARDIAC1
Cardiac index at time 1
7.6300000
URINE1
Urinary output at time 1
510.0000000
HGB1
Hemoglobin at time 1
18.0000000
SBP2
Systolic BP at time 2
182.0000000
MAP2
Mean arterial pressure at time 2
117.0000000
HEART2
Heart rate at time 2
221.0000000
CARDIAC2
Cardiac index at time 2
7.9400000
URINE2
Urinary output at time 2
850.0000000
HGB2
Hemoglobin at time 2
15.5000000
SHOCK
Binary Shock
2.0000000
DIED
1.0000000
SBPDIFF
94.0000000
----------------------------------------------------------
TITLE "FREQUENCY TABLES FOR SELECTED VARIABLES" ;
PROC FREQ;
TABLES SEX SURVIVE SEX SHOKTYPE SHOCK ;
RUN;
FREQUENCY TABLES FOR SELECTED VARIABLES
The FREQ Procedure
Cumulative
Cumulative
SEX
Frequency
Percent
Frequency
Percent
-------------------------------------------------------------1: Male
59
52.21
59
52.21
2: Female
54
47.79
113
100.00
Cumulative
Cumulative
SURVIVE
Frequency
Percent
Frequency
Percent
------------------------------------------------------------1: Lived
70
61.95
70
61.95
3: Died
43
38.05
113
100.00
Cumulative
Cumulative
SEX
Frequency
Percent
Frequency
Percent
-------------------------------------------------------------1: Male
59
52.21
59
52.21
2: Female
54
47.79
113
100.00
Cumulative
Cumulative
SHOKTYPE
Frequency
Percent
Frequency
Percent
------------------------------------------------------------------2: Non-Shock
34
30.09
34
30.09
3: Hypovolemic
17
15.04
51
45.13
4: Cardiogenic
20
17.70
71
62.83
5: Bacterial
16
14.16
87
76.99
6: Neurogenic
16
14.16
103
91.15
7: Other
10
8.85
113
100.00
Binary Shock
Cumulative
Cumulative
SHOCK
Frequency
Percent
Frequency
Percent
---------------------------------------------------------------1: No shock
34
30.09
34
30.09
2: Shock
79
69.91
113
100.00
CROSS TABULATIONS FOR SURVIVAL AND SHOCK TYPE
TITLE "CROSS TABULATIONS FOR SURVIVAL AND SHOCK TYPE";
PROC FREQ;
TABLES SHOCK*SURVIVE/CHISQ EXPECTED RELRISK;
RUN;
Table of SHOCK by SURVIVE
SHOCK(Binary Shock)
SURVIVE
Frequency
|
Expected
|
Percent
|
Row Pct
|
Col Pct
|1: Lived|3: Died | Total
------------+--------+--------+
1: No shock |
31 |
3 |
34
| 21.062 | 12.938 |
| 27.43 |
2.65 | 30.09
| 91.18 |
8.82 |
| 44.29 |
6.98 |
------------+--------+--------+
2: Shock
|
39 |
40 |
79
| 48.938 | 30.062 |
| 34.51 | 35.40 | 69.91
| 49.37 | 50.63 |
| 55.71 | 93.02 |
------------+--------+--------+
Total
70
43
113
61.95
38.05
100.00
Statistics for Table of SHOCK by SURVIVE
Statistic
DF
Value
Prob
-----------------------------------------------------Chi-Square
1
17.6265
<.0001
Likelihood Ratio Chi-Square
1
20.3389
<.0001
Continuity Adj. Chi-Square
1
15.8975
<.0001
Mantel-Haenszel Chi-Square
1
17.4705
<.0001
Phi Coefficient
0.3950
Contingency Coefficient
0.3673
Cramer's V
0.3950
Fisher's Exact Test
---------------------------------Cell (1,1) Frequency (F)
31
Left-sided Pr <= F
1.0000
Right-sided Pr >= F
1.142E-05
Table Probability (P)
1.043E-05
Two-sided Pr <= P
1.569E-05
Estimates of the Relative Risk (Row1/Row2)
Type of Study
Value
95% Confidence Limits
----------------------------------------------------------------Case-Control (Odds Ratio)
10.5983
2.9928
37.5317
Cohort (Col1 Risk)
1.8469
1.4433
2.3634
Cohort (Col2 Risk)
0.1743
0.0579
0.5247
TITLE "HISTOGRAMS" ;
PROC UNIVARIATE;
ID IDNUM;
VAR SBP1 URINE1 ;
HISTOGRAM;
RUN;
HISTOGRAMS
The UNIVARIATE Procedure
Variable: SBP1 (Systolic BP at time 1)
7
Moments
N
Mean
Std Deviation
Skewness
Uncorrected SS
Coeff Variation
111
105.855856
30.7691838
0.01630721
1347948
29.0670587
Sum Weights
Sum Observations
Variance
Kurtosis
Corrected SS
Std Error Mean
111
11750
946.74267
-0.5876705
104141.694
2.92048168
Basic Statistical Measures
Location
Mean
Median
Mode
Variability
105.8559
103.0000
80.0000
Std Deviation
Variance
Range
Interquartile Range
30.76918
946.74267
145.00000
48.00000
Note: The mode displayed is the smallest of 8 modes with a count of 3.
Tests for Location: Mu0=0
Test
-Statistic-
-----p Value------
Student's t
Sign
Signed Rank
t
M
S
Pr > |t|
Pr >= |M|
Pr >= |S|
36.24603
55.5
3108
Quantiles (Definition 5)
Quantile
100% Max
99%
95%
90%
75% Q3
50% Median
25% Q1
10%
5%
1%
0% Min
Estimate
171
166
154
149
131
103
83
67
56
45
26
<.0001
<.0001
<.0001
HISTOGRAMS
The UNIVARIATE Procedure
Variable: SBP1 (Systolic BP at time 1)
Extreme Observations
--------Lowest--------
--------Highest-------
Value
IDNUM
Obs
Value
IDNUM
Obs
26
45
48
52
55
596
662
653
730
724
38
63
57
103
100
158
158
159
166
171
659
691
742
679
722
61
75
110
69
98
Missing Values
Missing
Value
Count
.
2
-----Percent Of----Missing
All Obs
Obs
1.77
100.00
HISTOGRAMS
30
25
Percent
20
15
10
5
0
30
50
70
90
110
Systolic BP at time 1
130
150
170
HISTOGRAMS
Variable:
The UNIVARIATE Procedure
URINE1 (Urinary output at time 1)
Moments
113
Sum Weights
54.4336283
Sum Observations
112.348618
Variance
2.44944472
Kurtosis
1748509
Corrected SS
206.395609
Std Error Mean
N
Mean
Std Deviation
Skewness
Uncorrected SS
Coeff Variation
Basic Statistical Measures
Location
Variability
Mean
54.43363
Std Deviation
Median
1.00000
Variance
Mode
0.00000
Range
Interquartile Range
113
6151
12622.2121
5.2023573
1413687.75
10.568869
112.34862
12622
510.00000
41.00000
Tests for Location: Mu0=0
Test
-Statistic-----p Value-----Student's t
t 5.150374
Pr > |t|
<.0001
Sign
M
32
Pr >= |M|
<.0001
Signed Rank
S
1040
Pr >= |S|
<.0001
Quantiles (Definition 5)
Quantile
Estimate
100% Max
510
99%
450
95%
375
90%
200
75% Q3
41
50% Median
1
25% Q1
0
10%
0
5%
0
1%
0
0% Min
0
HISTOGRAMS
80
70
60
Percent
50
40
30
20
10
0
30
90
150
210
270
330
Urinary output at time 1
390
450
510
TITLE "INDEPENDENT SAMPLES T-TEST FOR SELECTED VARIABLES";RUN;
PROC TTEST;
CLASS SURVIVE;
VAR SBP1 HEART1 CARDIAC1 MAP1;
RUN;
INDEPENDENT SAMPLES T-TEST FOR SELECTED VARIABLES
The TTEST Procedure
Variable:
SURVIVE
1: Lived
3: Died
Diff (1-2)
SURVIVE
(Systolic BP at time 1)
N
Mean
Std Dev
Std Err
Minimum
Maximum
68
43
114.3
92.4651
21.8584
28.7275
29.3836
28.9821
3.4837
4.4810
5.6468
48.0000
26.0000
171.0
158.0
Method
1: Lived
3: Died
Diff (1-2)
Diff (1-2)
SBP1
Mean
Pooled
Satterthwaite
95% CL Mean
114.3
92.4651
21.8584
21.8584
107.4
83.4222
10.6667
10.5788
Method
Variances
Pooled
Satterthwaite
Equal
Unequal
Std Dev
121.3
101.5
33.0502
33.1380
28.7275
29.3836
28.9821
DF
t Value
Pr > |t|
109
87.969
3.87
3.85
0.0002
0.0002
95% CL Std Dev
24.5798
24.2280
25.5926
34.5722
37.3469
33.4146
Equality of Variances
Method
Num DF
Den DF
F Value
Pr > F
42
67
1.05
0.8547
Folded F
Variable:
SURVIVE
1: Lived
3: Died
Diff (1-2)
SURVIVE
1: Lived
3: Died
Diff (1-2)
Diff (1-2)
N
70
43
Method
Pooled
Satterthwaite
Method
Pooled
Satterthwaite
HEART1
Mean
102.4
107.8
-5.4425
(Heart rate at time 1)
Std Dev
30.1826
28.6791
29.6227
Mean
102.4
107.8
-5.4425
-5.4425
Std Err
3.6075
4.3735
5.7396
95% CL Mean
95.1746
109.6
98.9878
116.6
-16.8159
5.9308
-16.7015
5.8165
Variances
Equal
Unequal
DF
111
92.524
t Value
-0.95
-0.96
Minimum
25.0000
53.0000
Std Dev
30.1826
28.6791
29.6227
Maximum
217.0
176.0
95% CL Std Dev
25.8791 36.2163
23.6471 36.4514
26.1859 34.1061
Pr > |t|
0.3451
0.3396
Equality of Variances
Method
Num DF
Den DF
F Value
Pr > F
Folded F
69
42
1.11
0.731
Variable: CARDIAC1 (Cardiac index at time 1)
SURVIVE
1: Lived
3: Died
Diff (1-2)
SURVIVE
1: Lived
Method
N
Mean
Std Dev
Std Err
Minimum
Maximum
67
43
2.7148
2.3456
0.3692
1.5555
1.3489
1.4785
0.1900
0.2057
0.2889
0.3400
0.1700
7.6300
5.8900
Mean
2.7148
95% CL Mean
2.3354
3.0942
Std Dev
1.5555
95% CL Std Dev
1.3294
1.8748
3: Died
Diff (1-2)
Diff (1-2)
2.3456
0.3692
0.3692
Pooled
Satterthwaite
Method
Pooled
Satterthwaite
1.9305
-0.2035
-0.1865
Variances
Equal
Unequal
2.7607
0.9419
0.9249
DF
108
98.586
t Value
1.28
1.32
1.3489
1.4785
1.1122
1.3049
1.7144
1.7059
Pr > |t|
0.2040
0.1904
Equality of Variances
Method
Folded F
Variable:
SURVIVE
1: Lived
3: Died
Diff (1-2)
SURVIVE
1: Lived
3: Died
Diff (1-2)
Diff (1-2)
N
70
43
Num DF
66
MAP1
Pooled
Satterthwaite
F Value
1.33
Pr > F
0.3254
(Mean arterial pressure at time 1)
Mean
79.7286
63.1628
16.5658
Method
Den DF
42
Std Dev
19.5855
22.0658
20.5592
Mean
79.7286
63.1628
16.5658
16.5658
Method
Variances
Pooled
Satterthwaite
Equal
Unequal
Std Err
2.3409
3.3650
3.9835
95% CL
75.0586
56.3719
8.6722
8.4096
Mean
84.3986
69.9537
24.4593
24.7219
Minimum
32.0000
15.0000
Std Dev
19.5855
22.0658
20.5592
DF
t Value
Pr > |t|
111
80.948
4.16
4.04
<.0001
0.0001
Equality of Variances
Method
Folded F
Num DF
Den DF
F Value
Pr > F
42
69
1.27
0.3748
Maximum
124.0
116.0
95% CL Std Dev
16.7930 23.5008
18.1942 28.0459
18.1740 23.6709
TITLE "PAIRED T-TEST FOR SBP1 VS. SBP2";
PROC TTEST;
PAIRED SBP2*SBP1;
RUN;
PAIRED T-TEST FOR SBP1 VS. SBP2
The TTEST Procedure
Difference:
SBP2 - SBP1
N
Mean
Std Dev
Std Err
Minimum
Maximum
111
4.4414
35.6546
3.3842
-67.0000
94.0000
Mean
4.4414
95% CL Mean
-2.2652
Std Dev
11.1481
35.6546
DF
t Value
Pr > |t|
110
1.31
0.1921
95% CL Std Dev
31.5015
41.0791
PROC SORT;
BY SURVIVE ;
RUN;
TITLE "PAIRED T-TEST FOR SBP1 VS. SBP2";
TITLE2 "SEPARATELY FOR THOSE WHO SURVIVED AND THOSE WHO DIED";
PROC TTEST;
BY SURVIVE;
PAIRED SBP2*SBP1;
RUN;
PAIRED T-TEST FOR SBP1 VS. SBP2
SEPARATELY FOR THOSE WHO SURVIVED AND THOSE WHO DIED
-------------------------------------- SURVIVE=1: Lived -------------------------------------The TTEST Procedure
Difference:
N
68
Mean
16.3088
Mean
16.3088
Std Dev
30.3390
SBP2 - SBP1
Std Err
3.6791
95% CL Mean
8.9652 23.6524
DF
67
Minimum
-67.0000
Std Dev
30.3390
t Value
4.43
Maximum
94.0000
95% CL Std Dev
25.9587 36.5116
Pr > |t|
<.0001
-------------------------------------- SURVIVE=3: Died --------------------------------------The TTEST Procedure
Difference:
N
43
Mean
-14.3256
Mean
-14.3256
Std Dev
35.6723
SBP2 - SBP1
Std Err
5.4400
95% CL Mean
-25.3039 -3.3473
DF
42
t Value
-2.63
Minimum
-64.0000
Std Dev
35.6723
Pr > |t|
0.0118
Maximum
67.0000
95% CL Std Dev
29.4132 45.3398
TITLE "CORRELATIONS";
PROC CORR NOMISS;
VAR SBP2 CARDIAC1 HEART1 HGB1 MAP1 ;
RUN;
CORRELATIONS
The CORR Procedure
5
Variables:
SBP2
CARDIAC1 HEART1
HGB1
MAP1
Simple Statistics
Variable
N
Mean
Std Dev
Sum
Minimum
Maximum
SBP2
CARDIAC1
HEART1
HGB1
MAP1
110
110
110
110
110
110.79091
2.57045
105.07273
11.38455
72.76364
37.29183
1.48283
29.74377
2.54400
21.80772
12187
282.75000
11558
1252
8004
38.00000
0.17000
25.00000
6.60000
15.00000
182.00000
7.63000
217.00000
18.00000
124.00000
Simple Statistics
Variable
Label
SBP2
CARDIAC1
HEART1
HGB1
MAP1
Systolic BP at time 2
Cardiac index at time 1
Heart rate at time 1
Hemoglobin at time 1
Mean arterial pressure at time 1
Pearson Correlation Coefficients, N = 110
Prob > |r| under H0: Rho=0
SBP2
CARDIAC1
HEART1
HGB1
MAP1
SBP2
Systolic BP at time 2
1.00000
0.06743
0.4840
-0.06406
0.5061
0.00495
0.9591
0.41760
<.0001
CARDIAC1
Cardiac index at time 1
0.06743
0.4840
1.00000
-0.03104
0.7475
-0.47651
<.0001
0.03840
0.6904
HEART1
Heart rate at time 1
-0.06406
0.5061
-0.03104
0.7475
1.00000
0.12235
0.2029
-0.04472
0.6427
HGB1
Hemoglobin at time 1
0.00495
0.9591
-0.47651
<.0001
0.12235
0.2029
1.00000
0.19136
0.0452
MAP1
Mean arterial pressure at time 1
0.41760
<.0001
0.03840
0.6904
-0.04472
0.6427
0.19136
0.0452
1.00000
ODS GRAPHICS ON;
TITLE "REGRESSION ANALYSIS WITH DIAGNOSTIC PLOTS";
TITLE2 "AND ANALYSIS OF RESIDUALS";
PROC REG DATA=AFIFI;
MODEL SBP2= CARDIAC1 HEART1 HGB1 URINE1 MAP1 / PARTIAL;
OUTPUT OUT=REGDAT P=PREDICT R=RESID;
RUN;QUIT;
ODS GRAPHICS OFF;
REGRESSION ANALYSIS WITH DIAGNOSTIC PLOTS
AND ANALYSIS OF RESIDUALS
The REG Procedure
Model: MODEL1
Dependent Variable: SBP2 Systolic BP at time 2
Number of Observations Read
Number of Observations Used
Number of Observations with Missing Values
113
110
3
Analysis of Variance
DF
Sum of
Squares
Mean
Square
5
104
109
27680
123905
151584
5535.90734
1191.39091
Root MSE
Dependent Mean
Coeff Var
34.51653
110.79091
31.15466
Source
Model
Error
Corrected Total
R-Square
Adj R-Sq
F Value
Pr > F
4.65
0.0007
0.1826
0.1433
Parameter Estimates
Variable
Label
Intercept
CARDIAC1
HEART1
HGB1
URINE1
MAP1
Intercept
Cardiac index at time 1
Heart rate at time 1
Hemoglobin at time 1
Urinary output at time 1
Mean arterial pressure at time
1
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
1
1
1
1
1
1
71.16101
0.43401
-0.04167
-0.89439
0.00968
0.72203
24.12988
2.57598
0.11315
1.53879
0.03002
0.15889
2.95
0.17
-0.37
-0.58
0.32
4.54
0.0039
0.8665
0.7134
0.5623
0.7478
<.0001
TITLE "CHECK NORMALITY OF RESIDUALS";
PROC UNIVARIATE;
VAR RESID;
HISTOGRAM;
QQPLOT / NORMAL(MU=EST SIGMA=EST);
RUN;
CHECK NORMALITY OF RESIDUALS
The UNIVARIATE Procedure
Variable: RESID (Residual)
Moments
N
Mean
Std Deviation
Skewness
Uncorrected SS
Coeff Variation
110
0
33.7155742
0.08616288
123904.654
.
Sum Weights
Sum Observations
Variance
Kurtosis
Corrected SS
Std Error Mean
110
0
1136.73995
-0.6916866
123904.654
3.21465387
Basic Statistical Measures
Location
Mean
Median
Mode
0.00000
-2.60178
.
Variability
Std Deviation
Variance
Range
Interquartile Range
33.71557
1137
146.67216
45.21101
Tests for Location: Mu0=0
Test
-Statistic-
-----p Value------
Student's t
Sign
Signed Rank
t
M
S
Pr > |t|
Pr >= |M|
Pr >= |S|
0
-1
-22.5
Quantiles (Definition 5)
Quantile
Estimate
100% Max
99%
95%
90%
75% Q3
50% Median
25% Q1
10%
5%
1%
0% Min
77.37893
70.09634
54.34812
47.11394
21.71550
-2.60178
-23.49551
-49.32451
-53.89487
-58.95016
-69.29323
1.0000
0.9241
0.9469
CHECK NORMALITY OF RESIDUALS
22.5
20.0
17.5
Percent
15.0
12.5
10.0
7.5
5.0
2.5
0
-70
-50
-30
-10
10
30
50
70
Residual
CHECK NORMALITY OF RESIDUALS
100
75
Residual
50
25
0
-25
-50
-75
-3
-2
-1
0
Normal Quantiles
1
2
3
TITLE "ONEWAY ANALYSIS OF VARIANCE";
TITLE2 "WITH TUKEY MULTIPLE COMPARISON METHOD";
PROC GLM;
CLASS SHOKTYPE;
MODEL SBP1=SHOKTYPE;
LSMEANS SHOKTYPE/ ADJUST=TUKEY ;
RUN;QUIT;
ONEWAY ANALYSIS OF VARIANCE
WITH TUKEY MULTIPLE COMPARISON METHOD
21
The GLM Procedure
Class Level Information
Class
Levels
SHOKTYPE
6
Values
2: Non-Shock 3: Hypovolemic 4: Cardiogenic 5: Bacterial 6: Neurogenic 7:
Other
Number of Observations Read
Number of Observations Used
Dependent Variable: SBP1
113
111
Systolic BP at time 1
Source
Model
Error
Corrected Total
DF
5
105
110
R-Square
0.217422
Sum of
Squares
22642.7351
81498.9586
104141.6937
Coeff Var
26.31882
Mean Square
4528.5470
776.1806
Root MSE
27.86002
F Value
5.83
Pr > F
<.0001
SBP1 Mean
105.8559
Source
SHOKTYPE
DF
5
Type I SS
22642.73509
Mean Square
4528.54702
F Value
5.83
Pr > F
<.0001
Source
SHOKTYPE
DF
5
Type III SS
22642.73509
Mean Square
4528.54702
F Value
5.83
Pr > F
<.0001
Least Squares Means
Adjustment for Multiple Comparisons: Tukey-Kramer
SHOKTYPE
2:
3:
4:
5:
6:
7:
Non-Shock
Hypovolemic
Cardiogenic
Bacterial
Neurogenic
Other
SBP1 LSMEAN
LSMEAN
Number
127.151515
91.941176
102.000000
94.062500
95.437500
102.100000
1
2
3
4
5
6
Least Squares Means for effect SHOKTYPE
Pr > |t| for H0: LSMean(i)=LSMean(j)
Dependent Variable: SBP1
i/j
1
1
2
3
0.0007
0.0264
2
3
4
5
6
0.0007
0.0264
0.8877
0.0023
0.9999
0.9593
0.0040
0.9992
0.9822
0.1362
0.9419
1.0000
0.8877
4
5
6
0.0023
0.0040
0.1362
0.9999
0.9992
0.9419
0.9593
0.9822
1.0000
1.0000
1.0000
0.9797
0.9797
0.9913
0.9913
TITLE "LOGISTIC REGRESSION";
PROC LOGISTIC DESCENDING;
CLASS SHOKTYPE / PARAM=REF REF=FIRST;
MODEL DIED = SHOKTYPE SBP1 CARDIAC1/ RSQUARE LACKFIT;
UNITS SBP1=1 10;
RUN;
LOGISTIC REGRESSION
The LOGISTIC Procedure
Model Information
Data Set
Response Variable
Number of Response Levels
Model
Optimization Technique
WORK.REGDAT
DIED
2
binary logit
Fisher's scoring
Number of Observations Read
Number of Observations Used
113
109
Response Profile
Ordered
Value
DIED
Total
Frequency
1
2
1
0
43
66
Probability modeled is DIED=1.
NOTE: 4 observations were deleted due to missing values for the response or explanatory
variables.
Class Level Information
Class
Value
SHOKTYPE
2:
3:
4:
5:
6:
7:
Design Variables
Non-Shock
Hypovolemic
Cardiogenic
Bacterial
Neurogenic
Other
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
Model Convergence Status
Convergence criterion (GCONV=1E-8) satisfied.
Model Fit Statistics
Criterion
Intercept
Only
Intercept
and
Covariates
0
0
0
0
1
0
0
0
0
0
0
1
AIC
SC
-2 Log L
R-Square
148.216
150.908
146.216
0.2254
134.371
155.902
118.371
Max-rescaled R-Square
0.3053
Testing Global Null Hypothesis: BETA=0
Test
Chi-Square
DF
Pr > ChiSq
27.8453
24.6488
19.0687
7
7
7
0.0002
0.0009
0.0080
Likelihood Ratio
Score
Wald
Type 3 Analysis of Effects
Effect
SHOKTYPE
SBP1
CARDIAC1
Parameter
Intercept
SHOKTYPE
SHOKTYPE
SHOKTYPE
SHOKTYPE
SHOKTYPE
SBP1
CARDIAC1
3:
4:
5:
6:
7:
DF
5
1
1
Wald
Chi-Square
11.0110
4.6370
0.0076
Pr > ChiSq
0.0512
0.0313
0.9305
Analysis of Maximum Likelihood Estimates
Standard
Wald
DF
Estimate
Error
Chi-Square
1
-0.1184
1.2591
0.0088
Hypovolemic
1
2.1055
0.8225
6.5526
Cardiogenic
1
2.0289
0.8170
6.1671
Bacterial
1
1.2276
0.8386
2.1430
Neurogenic
1
1.6402
0.8535
3.6936
Other
1
2.8387
0.9642
8.6684
1
-0.0179
0.00832
4.6370
1
0.0152
0.1748
0.0076
Pr > ChiSq
0.9251
0.0105
0.0130
0.1432
0.0546
0.0032
0.0313
0.9305
Odds Ratio Estimates
Point
Estimate
Effect
SHOKTYPE
SHOKTYPE
SHOKTYPE
SHOKTYPE
SHOKTYPE
SBP1
CARDIAC1
3:
4:
5:
6:
7:
Hypovolemic
Cardiogenic
Bacterial
Neurogenic
Other
vs
vs
vs
vs
vs
2:
2:
2:
2:
2:
Non-Shock
Non-Shock
Non-Shock
Non-Shock
Non-Shock
95% Wald
Confidence Limits
8.211
7.606
3.413
5.156
17.094
0.982
1.015
1.638
1.534
0.660
0.968
2.583
0.966
0.721
41.165
37.718
17.656
27.468
113.124
0.998
1.430
Association of Predicted Probabilities and Observed Responses
Percent Concordant
77.7
Somers' D
0.557
Percent Discordant
22.0
Gamma
0.559
Percent Tied
0.3
Tau-a
0.269
Pairs
2838
c
0.779
Odds Ratios
Effect
SBP1
SBP1
Unit
1.0000
10.0000
Estimate
0.982
0.836
Partition for the Hosmer and Lemeshow Test
Group
Total
1
11
DIED = 1
Observed
Expected
0
0.64
DIED = 0
Observed
Expected
11
10.36
2
3
4
5
6
7
8
9
10
11
11
11
11
11
11
11
11
10
2
2
5
3
4
5
6
8
8
1.01
1.57
3.42
4.15
4.90
5.76
6.49
7.37
7.69
Hosmer and Lemeshow Goodness-of-Fit Test
Chi-Square
DF
Pr > ChiSq
4.2647
8
0.8325
9
9
6
8
7
6
5
3
2
9.99
9.43
7.58
6.85
6.10
5.24
4.51
3.63
2.31
Download