BookmarkSubscribeRSS Feed
GregBond
Obsidian | Level 7

Thank you for your time, as I am new to SAS, but really enjoying learning more about it!

The retrospective chart-review has 4 dependent variables, and these dependent variables are based on certain set of criteria, respectively.

1) Eligible for bariatric (Based upon patients BMI and number of comorbidities)

2) Eligible for exercise prescription (Based upon a multitude of biologic variables)

3) Eligible for bariatric surgery and exercise prescription (Based upon the combination of the two listed above)

4) Non Eligible for any intervention (Does not meet any of the baseline criteria variables)

In a random sample of 500 patient records, I will have access to the independent variables that determine the outcome group.

Question 1: How do I code the outcome variables so SAS knows which group to place the patients based on their independent variables?

Question 2: How do I categorize the 500 patients into an outcome group based upon the independent variables?

Question 3: How do I get data from this model that outputs counts and percentages?

Once again, thank you for your time and I appreciate the help any of you may be so generous to give.

- Greg

1 REPLY 1
TomKari
Onyx | Level 15

Hi, Greg

Here are two alternatives:

1. If you have experience with SAS data steps, it can be done like this:

proc format;
value eligiblefmt
  1 = "Bariatric"
  2 = "Exercise Prescription"
  12 = "Bariatric and Exercise Prescription"
  3 = "Non Eligible"
;
run;

data outcomes;
set sashelp.shoes;

if Product = "Boot" and 5 <= Stores <= 15 then if Region = "Canada" and Inventory > 50000 then
  eligibility = 12;
else eligibility = 1;
else if Region = "Canada" and Inventory > 50000 then
  eligibility = 2;
else eligibility = 3;
format eligibility eligiblefmt.;
run;

2. On the other hand, if you like Proc SQL or are using Enterprise Guide, here's the equivalent:

proc format;
value eligiblefmt
  1 = "Bariatric"
  2 = "Exercise Prescription"
  12 = "Bariatric and Exercise Prescription"
  3 = "Non Eligible"
;
run;

proc sql;
create table outcomes as
  select *,
   CASE 
    WHEN Product = "Boot" and Stores between 5 and 15
    THEN
   CASE
    WHEN Region = "Canada" and Inventory > 50000
    THEN 12
   ELSE 1
   END
   ELSE
  CASE
   WHEN Region = "Canada" and Inventory > 50000
   THEN 2
  ELSE 3
  END
  END
as eligibility format=eligiblefmt.
  from sashelp.shoes;

To get some basic statistics, you can use:

proc freq data=outcomes;

tables eligibility;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1200 views
  • 0 likes
  • 2 in conversation