BookmarkSubscribeRSS Feed
justine1
Calcite | Level 5

Hi all,

 

I'm using PROC NLMIXED to generate a multivariate nonlinear mixed-effects model. I have two continuous longitudinal response (A1,A2). I attached the data sample here:

Screen Shot 2022-02-28 at 12.48.43.png

 

I try to use logistic nonlinear mixed effect model to fit each response across TU. and assume all the random variables follow

a joint multivariate normal distribution. The SAS code as follows:

 

 

proc nlmixed data = data1 method = gauss gconv = 0;
parms b1l=190 b2l=700 b3l=350 s2u1l=1000 s2el=60 s2u2l=1000 
b1k=190 b2k=700 b3k=350 s2u1k=1000 s2u2k=1000 s2ek=60 cov_u1lk cov_u2lk;
pi = arcos(-1);
num1 = b1l+u1l;
ex1 = exp(-(TU -(b2l + u2l))/b3l);
den1 = 1 + ex1;
num2 = b1k+u1k;
ex2 = exp(-(TU -(b2k + u2k))/b3k);
den2 = 1 + ex2;
if variable = "A1" then predv = num1/den1;
else if variable = "A2" then predv = num2/den2;
/*here I need to write down the log likelihood function (ll)*/
model value ~ general(ll);
random u1l u2l u1k u2k ~ normal([0,0,0,0],[s2u1l,0,s2u2l,cov_u1lk,0,s2u1k,0,cov_u2lk,0,s2u2k]) subject=ID;
run;

But I do not know how to write the log likelihood function. So, if anyone has any suggestions or could point me towards useful resources that would be great. Thanks a lot.

 

 

 

 

2 REPLIES 2
Rick_SAS
SAS Super FREQ

It depends on what the distribution is for the response or error terms of the regression model.  For an overview, see "Two simple ways to construct a log-likelihood function in SAS."

 

That article mentions that there are about 25 standard probability distributions that are supported by the LOGPDF function. Additional log-likelihood functions are written in the doc for PROC MCMC.

 

For an example that uses PROC NLMIXED, see the section "Maximum likelihood estimates for lognormal data" in the article "Two ways to compute maximum likelihood estimates in SAS."

justine1
Calcite | Level 5

Hi Rick,

 

Thank you for your suggestions and resources.

 

The response (A1, A2) for my data is continuous longitudinal data and

Screen Shot 2022-03-01 at 22.05.52.png

Screen Shot 2022-03-01 at 22.05.58.png

analogous to eqn. (1)-(4), concatenating response vectors of multiple features for individual i results in :

Screen Shot 2022-03-01 at 22.37.35.png

 We can assume all the random variables in eqn.(5) follow a joint multivariate normal distribution(Screen Shot 2022-03-01 at 22.16.15.png) to build the multivariate nonlinear mixed model. 

thus

Screen Shot 2022-03-01 at 22.19.35.png

 Based on eqn. (7) we can get the log likelihood function. However, how to write the variance in eqn. (7). Could you give me some suggestions? Thanks.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 647 views
  • 1 like
  • 2 in conversation