BookmarkSubscribeRSS Feed
MRM95
Calcite | Level 5

Hello SAS users

I'm having trouble estimating AUC on my data.

I have the following data (dummy example below):

 

data original_data2;
input ID rho Time Sp02;
datalines;
1 1 0 17
1 1 0 0
1 1 0.026 39.5
1 1 0.031 30.4
1 1 0.04 29.2
1 1 0.051 17.8
1 1 0.092 30.3
1 1 0.176 71.5
1 1 0.342 251
1 1 0.508 291
1 1 1.015 360
1 1 2.015 359
1 1 3.014 617
1 1 4.01 502
1 1 5.014 693
1 1 6.016 672
1 1 7.019 529
1 1 8.02 492
1 1 9.017 590
1 1 10.013 490
1 1 11.014 548
1 1 12.013 443
1 1 13.013 449
1 2 14.013 422
1 2 30.012 295
1 2 58.019 268
1 2 120.943 214
1 2 211.019 185
1 2 242.995 125
1 2 272.994 137
1 2 305.993 156
1 2 334.998 135
1 2 366.027 160
1 2 393.053 127
1 2 424.996 131
1 2 456.99 139
1 2 484.996 120
1 2 515.981 115
1 2 544.015 114
1 2 578.994 133
1 2 608.986 120
1 2 638.001 116
1 2 658.993 122
1 2 695.088 136
1 2 726.001 132
1 2 726.03 237
1 2 726.051 183
1 2 726.092 151
1 2 726.176 155
1 2 726.342 181
1 2 727.015 118
1 2 728.014 72.8
1 2 729.012 54.6
1 2 730.021 48.1
2 1 0 15
2 1 0 0
2 1 0.021 27.1
2 1 0.033 74.9
2 1 0.052 142
2 1 0.094 191
2 1 0.18 197
2 1 0.346 242
2 1 0.51 350
2 1 1.015 442
2 1 2.015 555
2 1 3.01 593
2 1 4.013 540
2 1 5.016 425
2 1 6.016 460
2 1 7.02 610
2 1 9 514
2 1 10.001 466
2 1 11.007 503
2 1 12.014 415
2 1 13.024 458
2 1 14.017 448
2 1 28.035 44.7
2 1 56.02 366
2 1 88.033 278
2 2 120.026 247
2 2 215.973 228
2 2 246.013 186
2 2 276.978 251
2 2 306.206 210
2 2 334.98 190
2 2 365.073 183
2 2 393.094 179
2 2 425.052 217
2 2 456.056 180
2 2 484.043 290
2 2 522.051 317
2 2 550.059 201
2 2 582.078 339
2 2 600.007 203
2 2 600.045 256
2 2 600.068 266
2 2 600.108 183
2 2 600.191 186
2 2 600.358 146
2 2 601.181 81.2
2 2 602.106 65
2 2 603.073 31.5
2 2 604.075 23.2
;
run;

 

With this data, how can I estimate the AUC (per ID) of when the variable Sp02 goes below 90.

 

Does anyone know how to do this? I've found some very helpful guidance from @PGStats on this topic in other posts (https://communities.sas.com/t5/Statistical-Procedures/Area-under-the-curve-calculation/td-p/273882), but still can't figure out this issue specifically.

 

Any help will be greatly appreciated, thank you!

1 REPLY 1

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1067 views
  • 1 like
  • 2 in conversation