I'm using SAS 9.4 full version. Is there a place in the following proc logist coding to put a where statement? I'd like to run this regression only when a binary variable CASE='1'.
proc logist descending; class VARIABLE1 VARIABLE2 VARIABLE3; model Payment=VARIABLE1 VARIABLE2 VARIABLE3 VARIABLE4 / rsquare; run;
You can specify a WHERE statement most anywhere;
where case eq '1';
... more statements ...
I usually use the data set option.
proc logistic data=sashelp.class(where=(age le 15)); class sex; model sex = height weight; run;
Did you try
proc logist descending; where case='1'; class VARIABLE1 VARIABLE2 VARIABLE3; model Payment=VARIABLE1 VARIABLE2 VARIABLE3 VARIABLE4 / rsquare; run;
It is a very good habit to always use the data= on the proc statement.
If you are working with multiple data sets with the same variables as in the modeling code there is a chance that you might just accidentally run this against the wrong data set if you run blocks of code manually.
Any chance that should be LOGISTIC?
if that doesn't work then this should
proc logist descending data=_last_(where= ( case='1') );
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.