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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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