Programming the statistical procedures from SAS

Mulitlevel independent variable in proc logistic

Reply
Regular Contributor
Posts: 173

Mulitlevel independent variable in proc logistic

Hi ,

I have a 4 level- variable that I want to use as one of the independent variable (renalicd9 ) in proc logiotic model,

The variable is coded as

0, (Normal renal finction)

1- Stage 3 chrnoic renal disease

2. Stage 4 chrnoic renal disease

3- Stage 5 chr rnal dis with dialysis.

I want to obtain the Odds ratio for mortality (variable "died")  for each of this category compared against those with normal renal function.(code = 0)

Can I use this multilevel variable as it is in the regression model or should I convert into 3 separate binary variables (coded as 0 and 1) and the run 3 different models?

What would give me  correct results?

At present after including the multilevel variable (highlighted) the the SAS code looks like this:

proc logistic data =library.nismicathcabg4 descending;

class  female  (ref= first) renalicd9 (ref=first) dm dmcx htn_c  aids alcohol ANEMDEF arth race1(ref=first)  ZIPINC_QRTL(ref=first) hosp_location h_contrl(ref=first) hosp_teach

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor

ulcer valve wghtloss cararrhythmia/param=ref;

model died=  age female dm dmcx htn_c  aids alcohol ANEMDEF arth  race1 zipinc_qrtl hosp_location h_contrl hosp_teach  TOTAL_DISC

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renalicd9 tumor ulcer valve wghtloss cararrhythmia;

weight discwt;

title 'Logi Reg in-hosp mortality vs renalicd9 in MI patients with race + income';

run;

quit;

The output i got after running this is attached here..

Thanks

Super User
Posts: 18,569

Mulitlevel independent variable in proc logistic

Recoding as binary is effectively what SAS does.


See the design matrix for the variable recoded on page1/2 of your output and your estimates on page 10.

YOU DO NOT NEED TO RUN THREE DIFF MODELS.

Regular Contributor
Posts: 173

Mulitlevel independent variable in proc logistic

Thanks Reeza. Yes, I already had a look at the design variables and estimates and it looks good. But as i never used a multilevel indepedent variable in the model before, just wanted to confirm if it is alright to do and if the results are correct.

So, great, it means i can report the 3 Odds Ratios from page 10 of the output..

Thanks much.

Ashwini

Ask a Question
Discussion stats
  • 2 replies
  • 172 views
  • 0 likes
  • 2 in conversation