BookmarkSubscribeRSS Feed
OldSASGuy100
Fluorite | Level 6

Hello:

   I've seen a response to this question posted by Steve Dunham but there were some aspects that were unclear and in addition I was hoping that Steve or someone could make reference to the following code:

 

*nlmixed model including random factor and zip;

*in reality I have two random factors - bin, which is an indicator of the longitudinal nature of the data (nested under subject ID)

*subject id (ptid) which is the arbitrary identifier within the study;

proc nlmixed data=foo.nlmixed_data;

parms b0=1.35 b1=-.023 b2=-.2466 b3=-.0115 a0=-.2027 a1=.0606 a2=.2426 a3=.0127 sigma2=.0811;

logit0 = a0 + a1*studygroup + a2*treatst + a3*age;

prob0 = 1 / (1 + exp(-logit0));

mu = exp(b0 + u + b1*studygroup + b2*treatst + b3*age);

if count = 0 then   *likelihood if no counts - zip;

    ll = log(prob0 + (1 - prob0)*exp(-mu));

else      *count > 0;

   ll = count*log(mu) + log(1 - prob0) -mu -lgamma(count + 1);

model  count ~ general(ll);

* here's where I get lost;

*for one random factor the random stmt is ;

random u ~ normal(0, sigma2) subject = bin;

* but for two its more complex;

*bins are nestedwithin subject;

*random u v ~ normal([0,0] [subject_sigma2, cov, bin_sigma2]) subject = bin; *something like this;

run;

 

I really help somebody can help fill in the missing pieces.

 

Thanks,

OldSASGuy100

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Support for multiple RANDOM statements was added to PROC NLMIXED In SAS/STAT 13.2, which was shipped with SAS 9.4m2.

SAS 9.3 (from 2011) did not support multiple RANDOM statements. 

 

To see examples and discussion, read Kurada (2016) "Fitting Multilevel Hierarchical Mixed Models Using PROC NLMIXED"

OldSASGuy100
Fluorite | Level 6
unfortunately, I don't have access to SAS 13.2, I only have 9.3.

##- Please type your reply above this line. Simple formatting, no
attachments. -##

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
  • 1532 views
  • 0 likes
  • 2 in conversation