BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hello:

 

I would like to run a logistic model in the binary outcome (Y).  In the multivariates, I only need the condition 1 and 2.  Therefore, I use "and" to select all of them.  Am I correct?  Or should I use "or"?  Thanks.

 

proc logistic data=test;
class Y (ref="1") X1 (ref="2") X2 (ref="2") X3 (ref="2") X4 (ref="2") X5 (ref="2");
model Y = X1 X2 X3 X4 X5;
where X1 in (1,2) and X2 in (1,2) and X3 in (1,2) and X3 in (1,2) and X3 in (1,2);
run;
quit;

2 REPLIES 2
Reeza
Super User

Only you really know based on your logic. Make some test data and ensure it behaves the way you expect. 

Scenarios to test:

 

X1, X2, X3, X4, X5 all are either 1/2

Any of X1-X5 is not a 1/2

All of X1-X5 is not a 1/2

 

You may need to break these out into smaller cases but you'll probably understand your logic better at that point.

PGStats
Opal | Level 21

Get more insight about your data with:

 

proc sql;
select 
	x1, x2, x3, x4, x5, 
	count(*) as n,
	 case 
		when X1 in (1,2) and X2 in (1,2) and X3 in (1,2) and X4 in (1,2) and X5 in (1,2) then "Yes"
		else "No" end as included
	from test
	group by x1, x2, x3, x4, x5;
quit;
PG

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2059 views
  • 0 likes
  • 3 in conversation