I have 2 variables and I am looking to investigate the relationship between them. First of all, I am working with an excel sheet containing n=4533 observations. Of these observations, each can be categorized into a value between 1-8 known as 'admgrp' (admin group). This is the first variable.
The second variable is called 'los' (length of stay in days), for which every observation has a value.
Basically, I want to look at how 'admgrp' value influences the 'los' value.
I have isolated each 'admgrp' and found their mean 'los' using the attached code;
data SOR2002.admgrp1;
set SOR2002.elderly5;
if admgrp = '1';
run;
proc means data=SOR2002.admgrp1;
run;
Where SOR2002.elderly5 is the data set containing all 4533 observations. The above code demonstrates how I isolated admgrp 1, with similar code used to isolate the other 7 admgrps. I then use proc means on each individual admgrp to find their respective means for 'los'.
Now what I want to do is produce a bar graph showing each admgrp along the horizontal axis against their mean 'los' along the vertical axis.
I assume my first step would be trying to produce a 2-column table; one containing the 8 admgrps and the other containing their 8 respective mean 'los'. I am unsure how to do this.
Is there some way perhaps that you can produce a new variable called 'average los' and then set it equal to some calculation which returns the mean for each admgrps 'los'? Or is there a way to do it involving the proc means statement? Any advice is appreciated!