Using %NLINMIX MACRO to analyze hierarchical structure data set

Reply
Occasional Contributor
Posts: 5

Using %NLINMIX MACRO to analyze hierarchical structure data set

I am using %NLINMIX MACRO to analyze a data set with hierarchical structure and I want to include some variables in the data set as random variables in the model statement, what should I do?

Grand Advisor
Posts: 17,325

Re: Using %NLINMIX MACRO to analyze hierarchical structure data set

Consider posting this in Statistical Procedures.

25032 - %NLINMIX macro to fit nonlinear mixed models


Also, the NLINMIX macro page helpfully points out that NLMIXED procedure exists as of SAS 8 so you may not need the macro.

The NLMIXED procedure does have the RANDOM statement as well.

SAS/STAT(R) 9.2 User's Guide, Second Edition

Occasional Contributor
Posts: 5

Re: Using %NLINMIX MACRO to analyze hierarchical structure data set

NLMIXED can handle only one random statement. It cannot handle hierarchical structured data set with multiple random statements.

Respected Advisor
Posts: 2,655

Re: Using %NLINMIX MACRO to analyze hierarchical structure data set

Definitely time for an upgrade to at least SAS/STAT13.2.  The documentation now includes Example 70.7 Overdispersion Hierarchical Nonlinear Mixed Model, which fits a two level (animal and sample within animal) hierarchical model.

Steve Denham

Occasional Contributor
Posts: 5

Re: Using %NLINMIX MACRO to analyze hierarchical structure data set

In my analysis using NLINMIX macro, I discovered that when modeling repeated measured data set with hierarchical structure, for example, school within city, city within state and state within region, your RANDOM statement should be expressed as follows:

Class state city school;

     model pseudo_y = d_x1 d_x2 ... + cityeffect  + stateeffect / noint notest solution cl;

     random d_cityeffect / subject=city(state);

     random d_stateeffect / subject=state;

     )

)

run;

Ask a Question
Discussion stats
  • 4 replies
  • 441 views
  • 0 likes
  • 3 in conversation