BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

We have some data on subjects who belong to 2 different groups. Each subject has measures taken at several time points, and these measures are correlated. The form of the data for each subject in one group is such that it follows an exponential curve: y=A*(1-exp(-x/t)) + C. Individuals in the second group follow more or less the same form, but there are clear differences between the two groups as a whole. My ultimate aim is to show differences between these groups. I am letting A, t and C be random effects (changing between subjects), but I also want to account for the covariance in the measures within each subject.

I have been trying to use PROC NLMIXED for this, but am unsure whether it accounts for within subject covariance (as in PROC MIXED). How can I specify this? Is a better option to go with the %NLINMIX macro?

Any help in this regard would be highly appreciated.

Thanks.
4 REPLIES 4
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12
You can certainly account for random effects in nonlinear models with NLMIXED (it is one of the reasons that the procedure exists). But, we can't tell if you are using the procedure in an appropriate manner. There is a lot of programming involved in the use of this procedure. If you haven't read it yet, you should get a copy (buy or borrow) the book: SAS for Mixed Models, 2nd edition (SAS Press). The chapter on nonlinear mixed models is a wonderful place to start.

There are good uses for %NLINMIX also, and the above book chapter deals with this macro as well.
deleted_user
Not applicable
Thanks for your note.

I understand that random effects can be taken into account using NLMIXED. However, my real question is whether there is any way to specify a covariance structure for repeated measures within an individual.

Please let me know.
Dale
Pyrite | Level 9
It is possible in some cases to incorporate a covariance structure for repeated measures into NLMIXED code. However, it is not easy. I would point you to a couple of posts which I have made to SAS-l which should assist you in understanding how to code a likelihood function which incorporates a covariance structure for repeated measures. These are some long posts, so be prepared to do quite a bit of reading and then be prepared for a considerable amount of coding.

Just to give you a very brief response here, you will need to employ some matrix operations (such as matrix multiplication, computing of a matrix determinant, and computing the inverse of a matrix). SAS has not made these matrix operations available for use in base SAS programming. The links to my previous posts (below) provide functionality for matrix operations and demonstrate how to use these functions in NLMIXED code. The second post below has improved versions of some of the matrix operations.

See:
http://listserv.uga.edu/cgi-bin/wa?A2=ind1003C&L=sas-l&P=R20177
http://listserv.uga.edu/cgi-bin/wa?A2=ind1101B&L=sas-l&P=R141588

Good luck.
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12
It is also possible to use a REPEATED statement directly using the %NLINMIX macro. This macro uses a different model fitting method compared with NLMIXED, and can be slow, and can be tricky.

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 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
  • 4 replies
  • 1379 views
  • 0 likes
  • 3 in conversation