BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pubhealthguy
Calcite | Level 5

Hi,

 

I am working with an NHANES dataset and have randomly split it using

 proc surveyselect data=Table1 samprate=0.50 outall seed=1234 out=SplitData 
           method=srs noprint;
		         run;

Now I am wanting to compare outcomes for two methods of measuring blood pressure. Each group has been assigned one of the methods. For example, I want to know if there is statistical difference between the two groups with prevalence of MI/Stroke/Heart Failure. As an example, for Group 1 MI=40, Stroke=39, HF=40 and Group 2 MI=54, Stroke=47  HF=49. Are there statistically significant more MIs in Group 2?

I am brand new to SAS and cannot understand how to do this. The best I've come up with is

proc freq data = SplitData1 order=formatted;
tables MI? * BloodPressure?/ chisq;
run;

Do I need to turn Blood Pressure which is a continuous variable into a categorical variable?

I would really appreciate some advice. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

If you still want to go with the proc freq analysis, I think you need:

 

proc freq data = SplitData1;
tables MI * Selected / chisq;
run;

Variable Selected is created by proc surveyselect in the output dataset when you use option outall.

PG

View solution in original post

2 REPLIES 2
ballardw
Super User

Do you want to compare this across the entire data set? If so, what is the purpose of splitting the data?

 

I believe that NHANES data is a complex survey structure and would require the SURVEY versions of Freq , Means and such for analysis.

 

I strongly suggest that you investigate the links here:  https://www.cdc.gov/nchs/tutorials/NHANES/downloads/intro.htm

to find example code.

 

If you want to deal with the FREQ type output then likely you need to create categories for anything that has a continuous measure like blood pressure, temperature or even age as otherwise you are very likely to have too few counts in many cells for reliable analysis.

 

Observation weight values need to be accounted for as well.

PGStats
Opal | Level 21

If you still want to go with the proc freq analysis, I think you need:

 

proc freq data = SplitData1;
tables MI * Selected / chisq;
run;

Variable Selected is created by proc surveyselect in the output dataset when you use option outall.

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 473 views
  • 2 likes
  • 3 in conversation