-1

I have a mixed model with the following parameters:

  • A slope and intercept term for group 1
  • A different slope and intercept term for group 2
  • A random effect which is indexed by group/subject within group

Is there a way to model this using proc mixed? I can't seem to figure out how to get different slopes/intercepts for the two groups.

1 Answers1

1

This shows a simple model with separate intercept and slope. First BY GROUP then with GROUPS as a factor, and pooled estimate of error. Maybe if you should some example data we can figure the RANDOM part.

data group;
   do group=1,2;
      do x = 1 to 10;
         y = rannor(1);
         output;
         end;
      end;
   Run;
ods select SolutionF;
proc mixed;
   by group;
   model y = x / solution;
   run;
ods select SolutionF;
proc mixed;
   class group;
   model y = group x(group) / noint solution;
   run;

enter image description here

data _null_
  • 8,534
  • 12
  • 14