Hi all. I am having a hard time and was hoping that someone could help me with the code I need to use for my exact logistic regression test? First, is my data file set up correctly? I am testing the yes/no (binary) presence of skeletal stress against military service length of a sample of 29 decedents. In column A I have Years (this is active years of military service) and column B has a 0 or a 1 where 0 means no and 1 means yes. If this is correct, how would I set up my code? I have tried looking up examples and mimicking that but am not having the best luck and am not the most confident after doing that. It appears that I need three columns of data unless I'm just looking at examples that are too different from what my data is. If I need to set up my data a little differently, please let me know. For example, should column A have the years and then column B have the quantity of yes and column C have the quantity of no rather than each person getting their own data row? I am happy to provide any other info upon request. Thank you in advance.
Years | Porosity |
0 | 0 |
1 | 1 |
1 | 1 |
1 | 1 |
1 | 1 |
1 | 1 |
1 | 1 |
1 | 0 |
1 | 1 |
1 | 1 |
1 | 1 |
1 | 0 |
1 | 1 |
1 | 1 |
2 | 1 |
2 | 1 |
2 | 1 |
2 | 1 |
3 | 1 |
3 | 1 |
3 | 1 |
3 | 1 |
5 | 1 |
6 | 0 |
12 | 1 |
19 | 1 |
19 | 1 |
21 | 1 |
25 | 1 |
This is just a simple logistic model. You can always use individual level data like this, but alternative response syntax is available if the data is aggregated into counts like you mentioned. You don't really need exact estimation since the default asymptotic method seems to converge to a proper solution. You can add the EXACT statement if you really want, but the results are similar.
proc logistic;
model porosity(event="1")=years;
run;
@StatDave - you helped me a lot on my last post so maybe you have some input? Many thanks in advance
This is just a simple logistic model. You can always use individual level data like this, but alternative response syntax is available if the data is aggregated into counts like you mentioned. You don't really need exact estimation since the default asymptotic method seems to converge to a proper solution. You can add the EXACT statement if you really want, but the results are similar.
proc logistic;
model porosity(event="1")=years;
run;
Hello,
Performing Exact Logistic Regression with the SAS System — Revised 2009
Robert E. Derr, SAS Institute Inc., Cary, NC
https://support.sas.com/rnd/app/stat/papers/exactlogistic2009.pdf
Exact Logistic Regression and Exact Poisson Regression
https://support.sas.com/rnd/app/stat/topics/exact/exact.htm
Exact Methods
https://support.sas.com/rnd/app/stat/topics/exact-methods.html
Koen
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.