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

Hi SAS community,

I have a dataset where I need to test whether there are significant differences between GroupA and GroupB. GroupA and GroupB are values obtained from an experiment that was repeated over 3 days (Day = 1, 2, 3). Measurements are obtained over 6 hours for each of the 3 days starting at 0 (Hour = 0, 1, 2, 3, 4, 5, 6). My speciality is sampling (not this) and I know the basics of proc glm, proc mixed, proc anavo, proc ttest and so, but since the values are obtained hourly, the values per group are not independent of each other, so I don't think this proc glm or so will work. I was told that I will have to do survival analysis using proc PHReg. I don't know proc PHReg and am not sure if survival analysis is the correct method to determine if the groups differ significantly from one another. Any assistance will be greatly appreciated.

 

The code for the data is below:

data Data1;
input Day Hour GroupA GroupB;
datalines;
1 0 240000000 190000000
1 1 1000000000 4000000000
1 2 800000000 13000000000
1 3 23000000000 15000000000
1 4 15000000000 30000000000
1 5 24000000000 30000000000
1 6 30000000000 30000000000
2 0 9000000000 8000000000
2 1 290000000 1900000000
2 2 5000000000 13000000000
2 3 5000000000 30000000000
2 4 25000000000 30000000000
2 5 18000000000 30000000000
2 6 30000000000 30000000000
3 0 2200000000 30000000000
3 1 1200000000 30000000000
3 2 9000000000 10000000000
3 3 21000000000 30000000000
3 4 30000000000 30000000000
3 5 30000000000 30000000000
3 6 30000000000 30000000000
;

 

Thank you so much,

Francois

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Here are some ideas to get you started.

1. Change the data to "long" format, with a new variable 'Group' having values 'A' or 'B'.

2. Rescale your responses.  All those zeroes are going to lead to very small values for the coefficients, and very large values for the variance-covariance matrix.

3. Try using PROC MIXED to fit a doubly repeated measures model (Kronecker product), where the correlation between days is fit separately from the correlation between hours.  If that doesn't get you where you want to go, you might consider consolidating the time points into one variable, say hours since study start on Day 1.  Then Day effects and differences could be extracted by using CONTRAST or LSMESTIMATE statements.

4. If you feel that a semiparametric method would be better, you might consider these new time points to be continuous, and fit a spline using the EFFECT statement in PROC GLIMMIX.

 

SteveDenham

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

Here are some ideas to get you started.

1. Change the data to "long" format, with a new variable 'Group' having values 'A' or 'B'.

2. Rescale your responses.  All those zeroes are going to lead to very small values for the coefficients, and very large values for the variance-covariance matrix.

3. Try using PROC MIXED to fit a doubly repeated measures model (Kronecker product), where the correlation between days is fit separately from the correlation between hours.  If that doesn't get you where you want to go, you might consider consolidating the time points into one variable, say hours since study start on Day 1.  Then Day effects and differences could be extracted by using CONTRAST or LSMESTIMATE statements.

4. If you feel that a semiparametric method would be better, you might consider these new time points to be continuous, and fit a spline using the EFFECT statement in PROC GLIMMIX.

 

SteveDenham

FrancoisN
Calcite | Level 5

Thank you so much for the reply, I appreciate it. I have played around with proc mixed using the information you provided in point 3.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 423 views
  • 1 like
  • 2 in conversation