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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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