hi every one, this is the first time I learned about SAS, I am using proc logistic to compare the odds of an outcome between people who are 70 years old and who are 15 years older than them, how should I write down the code to locate the population who are 70 years old?
here is my code
proc logistic data= lungcancer desc;
model casecont= age/clodds=wald; where age =70;
units age=15;
run;
it works, but it does not give a odds ratio and includes all the observations, i know this is wrong, please help me out, please
Where statements filter the records. So the data only had age=70. So there was no other value to compare or create odds ratio from.
If want to use exactly two values of age then you could filter to those using:
where age in (70 85);
Typically the way many of the regression procedures work the "set up" information about variables needs to be defined before the Model statement. So try the WHERE before the MODEL. If that still "uses all the observations" then include the LOG in another post. Copy the text from the log. Then on the forum open a text box using the </> icon that appears above the message window and then paste in the box.
The text will preserve text formatting of any Log diagnostics. The main message windows will reformat text pasted so anything that may be sensitive to position really should be pasted into a text box. You can see what the text box looks like above.
It is a good idea to post code that way as well. One it sets the code apart from general question text and second, if you use any indents to structure code, the text box preserves such.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!