BookmarkSubscribeRSS Feed
iressa131
Calcite | Level 5

Hi!

 

How would i test for an association between a variable and just 1 level of another variable? 

I only have the 2x2 table. 

I have the following code for testing between two variables. Thanks for any help!

DATA PBP2;
DO a=1 TO 2;
DO b=1 TO 2;
INPUT count @@;
OUTPUT;
END;
END;
CARDS;
146 54 159 41
;
RUN;
PROC FREQ;
TITLE6 "Output" ;
WEIGHT count;
TABLES a*b /CHISQ;
RUN;
3 REPLIES 3
iressa131
Calcite | Level 5

Hi!

 

How would i test for an association between a variable and just 1 level of another variable? 

I only have the 2x2 table. 

I have the following code for testing between two variables. Thanks for any help!

DATA PBP2;
DO a=1 TO 2;
DO b=1 TO 2;
INPUT count @@;
OUTPUT;
END;
END;
CARDS;146 54 159 41;
RUN;
PROC FREQ;
TITLE6 "Output" ;
WEIGHT count;
TABLES a*b /CHISQ;
RUN;
ballardw
Super User

@iressa131 wrote:

Hi!

 

How would i test for an association between a variable and just 1 level of another variable? 

I only have the 2x2 table. 


I am not sure what you mean by that type of test? What exactly would you be testing for? In your example which level of which variable are you testing against in the other?

 

Note that your code does not run as posted.

The CARDS and DATALINE statements must 1) have the Cards or datalines as the only statement on one line of code and 2) the ; or ;;;; in the case of Cards4 or equivalent must be on a line by itself, not at the end or a row of data.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 695 views
  • 0 likes
  • 3 in conversation