turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Help with Non-linear mixed models

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-24-2011 03:24 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-01-2011 05:04 PM

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.

There are good uses for %NLINMIX also, and the above book chapter deals with this macro as well.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-01-2011 05:28 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-01-2011 08:43 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-02-2011 10:42 AM

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.