Programming the statistical procedures from SAS

Assistance needed in model selection for retrospective chart-review study

Reply
Contributor
Posts: 26

Assistance needed in model selection for retrospective chart-review study

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

PROC Star
Posts: 1,134

Re: Assistance needed in model selection for retrospective chart-review study

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;

Ask a Question
Discussion stats
  • 1 reply
  • 152 views
  • 0 likes
  • 2 in conversation