BookmarkSubscribeRSS Feed
AK
Calcite | Level 5 AK
Calcite | Level 5
I have repeated measures data that contains subjects' performance on a task over many trials. I also have a group variable as well (three groups, and this variable is categorical- there is no order to the groups).
In NLMIXED, I get the parameters for an exponential function that describes the learning curves. Specifically, I have a parameter that reflects the asymptote and another that reflects the learning rate (ie, a time constant). I also find that there is a significant effect of my group variable on the asymptote parameter, but not the learning rate. This all looks good and the fit is nice.
**How can I test for differences between pairs of groups?** Ie, the hypothesis that Group A does not differ from Group B, but does differ from Group C. Here are some avenues I've tried, with little luck:

1. Use the CONTRAST statement. This really seems like the what I'm supposed to do, but I just can't figure out the syntax, and how to code the data to use it! I read that it's *not* executed the same was as the contrast statement in PROC MIXED, but I can't seem to find the right way.

2. Get each individual subjects' parameter estimate, then determine (in a separate analysis) whether there is a signif effect of group on the estimate. The output gives me the mean and variance of the estimate, but can I get the estimate for each individual? Or, should I run NLMIXED on each subject (without the group variable, of course), and get the parameters from each output?


Would either of these work? Thanks for any insight!

Code so far:
PROC NLMIXED DATA = data;
PARMS m_g0 = 1 m_g2 = -0.5 b01 = 0 b21 = 0
s2e = 0.1 v_Ey0 = 0.1 v_Ey1 = 0.1 c_01 = 0.1;
g0 = m_g0 + b01*group + Ey0;
g2 = m_g2 + b21*group + Ey1;
eqn = g0 + (-exp(trial * g2)) ;
MODEL adapt ~ normal(eqn,s2e) ;
RANDOM Ey0 Ey1 ~ normal([0, 0], [v_Ey0, c_01, v_Ey1])
SUBJECT = subject;

~AK
2 REPLIES 2
Dale
Pyrite | Level 9
AK,

First of all, I don't think you have coded your group effects appropriately. Since you have three unordered groups, you should have three models for the asymptote and also three models for the learning rate. The three asymptote models can all be written employing a single statement of the form:

    g0 = m_g0 + b01*(group=2) + b02*(group=3) + Ey0;

This statement resolves to

      g0 = m_g0 + Ey0;                (group=1)
      g0 = m_g0 + b01 + Ey0;       (group=2)
      g0 = m_g0 + b02 + Ey0;       (group=3)

Similarly, the expression for g2 would be:

      g2 = m_g2 + b21*(group=2) + b22*(group=3) + Ey1;


Now, if you want to see if there is variation across groups in their asymptotic values, you would want a 2 df test that examines whether the b01 and b11 values differ from 0:

    contrast "Difference in asymptotic values" b01, b02;

Similarly, you should have a 2 df test for the learning rates:

    contrast "Difference in learning rates" b21, b22;


At trial=, there is a 3 df test which compares

    m_g0 + (-exp(*m_g2))
    m_b0 + b01 + (-exp(*(m_g2 + b21)))
    m_b0 + b02 + (-exp(*(m_g2 + b22)))


At trial=1, this contrast would be

    contrast "Diff across 3 groups at trial=1)
        ( m_b0 + b01 + (-exp(1*(m_g2 + b21))) ) - ( m_g0 + (-exp(1*m_g2)) ),
        ( m_b0 + b02 + (-exp(1*(m_g2 + b22))) ) - ( m_g0 + (-exp(1*m_g2)) );

Similarly, at trial=2 you would have the 3 group contrast

    contrast "Diff across 3 groups at trial=2)
          ( m_b0 + b01 + (-exp(2*(m_g2 + b21))) ) - ( m_g0 + (-exp(2*m_g2)) ),
          ( m_b0 + b02 + (-exp(2*(m_g2 + b22))) ) - ( m_g0 + (-exp(2*m_g2)) );


A contrast comparing expected values for groups 1 and 2 at trial=j would have the form:

    contrast "E(G=2) - E(G=1) at trial=[j[)
          ( m_b0 + b01 + (-exp(*(m_g2 + b21))) ) - ( m_g0 + (-exp(*m_g2)) ),

Just be sure to substitute specific values for everywhere in the above equation. Similarly, you can construct contrasts between expected values for groups 1 and 3 and also between expected values for groups 2 and 3. I'll let you work out the code for these latter two contrasts. It should be readily apparent from everything that has been shown above.

Dale
AK
Calcite | Level 5 AK
Calcite | Level 5
Right, of course! I felt like my version was off but I didn't know what the solution was. This makes complete sense, thanks very much for the clear and thorough reply. And thanks also for pointing out the trial contrast.

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
  • 2 replies
  • 1717 views
  • 0 likes
  • 2 in conversation