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

Hi,

I have a similar problem as one of the earlier post(with 3 random variables), , repeated measure of performance over 4-5 trials.  I have a group variable (ordinal - 3 groups).

I'd like to test the differences between the groups (1 vs 2, 1 vs 3, and 2 vs 3).

Here is my attempt to the code,

proc nlmixed data=long;

  parms a1=1 b1=.5 c1=.5 u1=.1 u2=.1 u3=.1 s2e=?? g11=?? g21=?? ...

             a2=0 a3=0 b2=0 b3=0 c2=0 c3=0;

  a=a1+a2*(group=2)+a3*(group=3)+u1;

  b=b1+b2*(group=2)+b3*(group=3)+u2;

  c=c1+c2*(group=2)+c3*(group=3)+u3;

   eqn=a/time**b+c;

   model performance ~ normal(eqn,s2e);

   random u1 u2 u3 ~ normal([0,0,0],[g11,g21,g11,g31,g32,g33]) subject=id;

run;

2 things I am having trouble with are:

1.  how to code "CONTRAST" to test the proper groups.  is it just

contrast "b1 vs b2" b1 - b2;

contrast "b1 vs b3" b1 - b3;

contrast "b2 vs b3" b2 - b3;

contrast "a1 vs a2" a1 - a2;

....

2.  how do I calculate the values to s2e, g11, g21....?

thanks in advance for your help.

ming

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

1.  It looks like these should work, but it may be worthwhile to consider using ESTIMATE statement due to the additional info it gives.

2.  Coming up with initial values, especially for covariances, is hard.  I would try the default values and see where that leads.  Then I would go back and refit with different values, roughly based on the results, and see if I got comparable convergence to the same values.  If you have a lot of time, you could try the grid searching option.

Another method would be to semi-linearize, and use PROC MIXED to get approximate starting values.  Subtract your best common estimate of c from performance, take the logs of both sides, and fit a regression model that accomodates the random effects and the values from the V matrix.

Steve Denham

View solution in original post

1 REPLY 1
SteveDenham
Jade | Level 19

1.  It looks like these should work, but it may be worthwhile to consider using ESTIMATE statement due to the additional info it gives.

2.  Coming up with initial values, especially for covariances, is hard.  I would try the default values and see where that leads.  Then I would go back and refit with different values, roughly based on the results, and see if I got comparable convergence to the same values.  If you have a lot of time, you could try the grid searching option.

Another method would be to semi-linearize, and use PROC MIXED to get approximate starting values.  Subtract your best common estimate of c from performance, take the logs of both sides, and fit a regression model that accomodates the random effects and the values from the V matrix.

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 738 views
  • 0 likes
  • 2 in conversation