N/A
Posts: 0

# Help with Non-linear mixed models

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.
Valued Guide
Posts: 684

## Re: Help with Non-linear mixed models

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.
N/A
Posts: 0

## Re: Help with Non-linear mixed models

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.

Regular Contributor
Posts: 171

## Re: Help with Non-linear mixed models

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.
Valued Guide
Posts: 684

## Re: Help with Non-linear mixed models

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.
Discussion stats
• 4 replies
• 136 views
• 0 likes
• 3 in conversation