Programming the statistical procedures from SAS

repeated measures question

Reply
Regular Contributor
Posts: 204

repeated measures question

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.

Respected Advisor
Posts: 2,655

Re: repeated measures question

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

Regular Contributor
Posts: 204

Re: repeated measures question

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!

Respected Advisor
Posts: 2,655

Re: repeated measures question

That model ought to be interpretable.

Steve Denham

Ask a Question
Discussion stats
  • 3 replies
  • 179 views
  • 1 like
  • 2 in conversation