BookmarkSubscribeRSS Feed
Kimberly09
Fluorite | Level 6

Hi - 

I'm searching for a SAS Proc procedure to use to obtain ttest and chi-square statistics while clustering by a location variable. I'm working with longitudinal data for a randomized controlled trial. It is in wide format (1 observation per subject per row). This is not survey data so Proc survey would not the an appropriate procedure to use for this data set. I could use the basic proc ttest or proc freq/chisq to obtain the results; however, I need to account for differences within location. I'm working with binary as well as continuous variables. 

 

For example, I want to test whether gender (gen 1 =male, 2 =female)  is statistically significant between the treatment and control groups (group_assign 0 = control, 1 = treatment) while clustering for location (1= NY, 2 = Chicago) and whether age (cont. var) is statistically significant between groups while clustering for location (if no clustering, I check this with proc ttest). 

 

I'll be grateful for any syntax or resource that could help me solve this problem .Thanks 

 

1 REPLY 1
cminard
Quartz | Level 8

Based on your description, I do not think that "clustering" is the correct term. I think that you want to adjust for the effects of location and age. I suggest a general linear model. But, you state that the data is "longitudinal" implying that you have repeated measures. If that is the case, then you may have to do something like a general linear mixed model with random effects.

 

Providing a sample of the data may be helpful to provide more specific recommendations.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 858 views
  • 0 likes
  • 2 in conversation