Hi All
The following table is a sample of my data set where the patients are the control before diagnosis and are the case after diagnosis.
New_id |
A1C pre |
A1C Cat pre |
A1C post |
A1C Cat post |
A |
7 |
0 |
6 |
0 |
B |
- |
- |
8 |
0 |
C |
9 |
1 |
- |
- |
D |
10 |
2 |
17 |
3 |
E |
- |
- |
- |
- |
F |
8 |
0 |
7 |
0 |
I would like to compare between the readings of A1C pre and post for each patient, to know if the exposure had an effect on the A1C level and if there is a significance difference.
Thanks for your help
@ALAA1 wrote:
Hi All
The following table is a sample of my data set where the patients are the control before diagnosis and are the case after diagnosis.
New_id
A1C pre
A1C Cat pre
A1C post
A1C Cat post
A
7
0
6
0
B
-
-
8
0
C
9
1
-
-
D
10
2
17
3
E
-
-
-
-
F
8
0
7
0
I would like to compare between the readings of A1C pre and post for each patient, to know if the exposure had an effect on the A1C level and if there is a significance difference.
Thanks for your help
Typically to make any statistically reliable statement about what I have highlighted in blue above you have to include all of the patients. One of the typical tests would be to test if the mean difference across all patients, or subgroups of patients such as gender, age or some such, is larger or smaller. One the tests used for such is a Paired t-test which tests if the mean difference between the before and after is 0 or not.
Another test might be a sign test, compare the before/after just in a larger/smaller way (magnitude makes no difference). This basically tests whether there is any difference in before/after.
But you use all of the patients. Why do you think they bothered to collect data from more than one patient?
To perform paired post-pre tests, create new variables for the change in values and test for location with proc univariate:
data have;
input New_id $ A1Cpre A1CcatPre A1Cpost A1CcatPost;
datalines;
A 7 0 6 0
B . . 8 0
C 9 1 . .
D 10 2 17 3
E . . . .
F 8 0 7 0
;
data change;
set have;
A1Cchange = A1Cpost - A1cpre;
A1CcatChange = A1CcatPost - A1CcatPre;
run;
proc univariate data=change;
var A1Cchange A1CcatChange;
run;
Look at the Tests for Location table.
Note: this is assuming that both your variables are ordinal.
@ALAA1 wrote:
Hi All
The following table is a sample of my data set where the patients are the control before diagnosis and are the case after diagnosis.
New_id
A1C pre
A1C Cat pre
A1C post
A1C Cat post
A
7
0
6
0
B
-
-
8
0
C
9
1
-
-
D
10
2
17
3
E
-
-
-
-
F
8
0
7
0
I would like to compare between the readings of A1C pre and post for each patient, to know if the exposure had an effect on the A1C level and if there is a significance difference.
Thanks for your help
Typically to make any statistically reliable statement about what I have highlighted in blue above you have to include all of the patients. One of the typical tests would be to test if the mean difference across all patients, or subgroups of patients such as gender, age or some such, is larger or smaller. One the tests used for such is a Paired t-test which tests if the mean difference between the before and after is 0 or not.
Another test might be a sign test, compare the before/after just in a larger/smaller way (magnitude makes no difference). This basically tests whether there is any difference in before/after.
But you use all of the patients. Why do you think they bothered to collect data from more than one patient?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.