BookmarkSubscribeRSS Feed
lsjung
Calcite | Level 5

Hello, so I am working with the Health and Retirement study dataset and I am trying to compare the proportion of males from the 2006 wave to the 2008 wave. These variables are gender06 and gender08 (male or female). I have not been able to figure out how to test whether or not the proportion of males are the same in both waves. I tried a chisq but since most observations have either gender06 or gender 08, this is not feasible as shown here: (I am also running into the same problem with race06 and race08, which has 3 different options)

proc freq data=ya;
	tables gender06 gender08 gender06*gender08 /chisq;
	tables race06 race08 race06*race08 /chisq;
run;

dsakldasjdlsada.png

1 REPLY 1
ballardw
Super User

I suggest that you go back into your processing and instead of naming variables by year to have an additional variable in the data to indicate year.

 

Then the chi-square with year*gender would make a lot more sense.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 525 views
  • 0 likes
  • 2 in conversation