BookmarkSubscribeRSS Feed
Miracle
Barite | Level 11

Hi there.

Could I please ask if someone could shed some light on this repeated measures question whether I'm doing it right?

My dataset has 3 variables of interest.

1) Intervention: A, B, C and D

2) ExperimentNo: 1,2,3 and 4

3) Concentration: the dependent variable

There are different numbers of Concentration for each pair of Intervention*ExperimentNo i.e. A1 has 300, B1 has 500, C4 has 150 etc. I'm interested in comparing the effect of Intervention.

I read the Clustered Data Example in the SAS Help & Documentation and tried the below model but it didn't converge which I don't understand why. I was thinking to take into account the concentration measurements from the same Intervention as well as those from the same level of Intervention*ExperimentNo.

proc mixed data=tmp order=internal;

    class Intervention ExperimentNo:

    model Concentration=Intervention / solution;

    random Intervention Intervention*ExperimentNo: ;

run;

Whereas, this one below runs with no problem.

proc mixed data=tmp order=internal;

    class Intervention experimentNum;

    model Concentration=Intervention / solution;

    random Intervention*ExperimentNo: ;

    lsmeans Intervention / cl e om pdiff=control('A');

run;

Your insight is greatly appreciated! Have a good day.

3 REPLIES 3
SteveDenham
Jade | Level 19

Even though the latter may run, I don't think it is doing what you think it may be.  The CLASS variable is 'experimentNum' while what is in the random statement is 'ExperimentNo'.

Try the following:

proc mixed data=tmp order=internal;

    class Intervention experimentNo subjectid;

    model Concentration=Intervention ExperimentNo Intervention*ExperimentNo / solution;

   repeated ExperimentNo/type=cs subject=subjectid(Intervention): ;

    lsmeans Intervention /diff=contro('A');

     slice Intervention*ExperimentNo/ sliceby=ExperimentNo diff=control('A') ;

run;

Note the addition of subjectid.  This should be available as the subject progresses from experiment 1 to 2 to 3 to 4.  Now if there is no subject that does this, we need to recast the analysis.

Let us know if this works for your design.

Steve Denham

Miracle
Barite | Level 11

Hi Steve. Thanks so much for your reply.

Unfortunately, there isn't subjectid or any sort. That experimentNum/experimentNo was a typo for the last model, my apology. It was meant to be experimentNo. Would you think the second model ok for interpretation in my case?

Much appreciated!! Have a nice day!

SteveDenham
Jade | Level 19

That model ought to be interpretable.

Steve Denham

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!

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
  • 3 replies
  • 1336 views
  • 1 like
  • 2 in conversation