Programming the statistical procedures from SAS

Need help with proc nlmixed coding

Occasional Contributor
Posts: 19

Need help with proc nlmixed coding

Dear All,

Good day and contacting you for some statistoical help. I need to Model trends in annual tree mortality rates by soil class.  To do this nonlinear generalized mixed model will be used. Nonlinear because demographic rates (ex. mortality rate) are compounded by the time interval, generalized because we were using count data. The data are counts of dead trees, counts of live trees at the previous time step, year of observation, intervals (in years) between censuses and soil type for 60 plots.


When analyzing trends across multiple plots, I need to add a normal random effect based on plot identity to the linear function to account for differences among plots. Specifically, to estimate changes in annual mortality rates, I need to model the rate as a logistic function:

exp(β0 + β1tj + γi) / (1 + exp[β0 + β1tj + γi]),


where i represents the plot number, j represents the census number, tj represents the duration between consecutive censuses, and β0, β1, and γi are regression parameters. I need to apply a statistical model to our data in which nij was the number of trees alive at the previous census for the i-th plot and the j-th census, and mij represents the corresponding mortality rate:



where pij represents the probability of mortality over the census interval, tj represents the year of the j-th census, and c represents the census interval in years. The random intercept parameter (γi) follows a normal distribution. The negative binomial distribution is an extension of the Poisson distribution with α > 0 representing over dispersion.


I am sharing you the link to access the data I am very new in this kind of analysis and really need help in coding. For the above, I need to use Proc nlmixed. It would be really great if you can help me to do this analysis specially with the codes. I would be really greatful to you.


Thanks and will be waittng for your kind resposne.


Kind Regards


Valued Guide
Valued Guide
Posts: 684

Re: Need help with proc nlmixed coding

Posted in reply to sohelsayma

This forum is not set up for such general questions. We don't write complete code from scratch. There is plenty of material in the User's Guide to get started using NLMIXED for the negative binomial (it is a built-in function), and for having a random intercept term. The book SAS for Mixed Models, 2nd edition (2006) also has lots of material on this topic. Once you have written and tested some code, we can then give specific advice on problems you run in to,.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation