Dear all,
Am trying to compare C-reactive protein (CRP) values of patients at visit1 and vist 2
I have table that looks like this :
| Variable | VISIT | N | Mean | STD |
| CRP | 1 | 300 | 3,64 | 1,19 |
| CRP | 2 | 148 | 1,95 | 0,93 |
I wish to compare the N value 148 at visit 2 with exactly 148 values at visit1. I think I can do this by selecting the pat_id with the 148values at visit2 and comparing that with exactly the same patients(with the same pat_id) in visit1
My question is how can I adjust my code to do that?
here is my code:
proc ttest data= myinfile plots=none;
class visit;
var CRP;
where visit in (1,2);
ods output ttests=ttest_CRP;
ods output Statistics=Stat_CRP;
run;
Check this example:
Before we show any code, could you clarify something here:
I wish to compare the N value 148 at visit 2 with exactly 148 values at visit1. I think I can do this by selecting the pat_id with the 148values at visit2 and comparing that with exactly the same patients(with the same pat_id) in visit1
If there are two measurements for each of the 148 patients, then you would want to do a paired t-test for these 148 patients. Is that what you have in mind?
@Ksharp @Reeza : Thanks for that.
@PaigeMiller Yes, that is approximately what I want. I think I will try that myself. Thanks
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.