I am looking to make a spaghetti plot for many observations with several stipulations. I want to compare two graphs. I want to separately consider those who have an age 18 BMI of 20-25 (“normal weight”) and those whose age 18 BMI is 25-50 (overweight). I was planning on making two graphs because I do not know how to superimpose my data or make more than one group (would love input on this if anyone knows). However, I have this code below and it's close but not quite there.
proc sgplot data = obese;
where ID LE 30 and age GE 18;
where also 25 >=BMI >= 20; /*I want this to be when when age is 18 but as age increases it then it can surpass these limits.*/
series x = Age y = BMI / group= ID break curvelabel;
yaxis values= (20 to 30 by 2);
xaxis values= (18 to 35 by 1 );
run;
I have the same code for the other graph. I have tried using the following but then it restricts it from the the people who really increase in BMI (which im interested in).
proc sgplot data = obese;
where ID LE 40 and age GE 18;
where also 60 >=BMI >= 25 and Age = 18;
series x = Age y = BMI / group= ID break curvelabel;
yaxis values= (20 to 30 by 2);
xaxis values= (18 to 35 by 1 );
run;
Any ideas? I am open to any suggestions at all. Even if they are "Why dont you use a different graph" etc. I'm new to SAS and VERY new to sgplot.
Thanks in advance.