BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
johamunoza0
Fluorite | Level 6

Dear All, 

 

At this moment I am running several non-linear mixed models with proc nlmixed.

However, due to the complexity of the models, I have to set the start values with the parameters of the same model but without random effects. 

Is there any way to save the parameters estimates from the model without random effects and use them on the final model?

Thanks in advance for any advise.

 

Johanna

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

For the most help, please provide sample code and sample data for your questions.

 

If I understand your questions, the answer is "yes." You can first compute the parameter estimates for a fixed-effect model and then use those estimates as starting values for a random effects model. For example, the PROC NLMIXED documentation contains data and an example of a random-effects model for the size of a rat litter.  If you ignore the random effect and replace that effect with 0 (its mean value), then the fixed effect model is as follows:

 

proc nlmixed data=rats;
   parms t1=1 t2=1;
   eta = x1*t1 + x2*t2;
   p   = probnorm(eta);
   model x ~ binomial(m,p);
   ods output ParameterEstimates = PE;
run;

Notice that the ODS OUTPUT statement saves the parameter estimates to a data set.  For the full random-effect model, you can use the DATA= option on the PARMS statement to read in the estimates from the fixed-effect model:

 

/* full random-effects model. The starting values for the fixed effects
   are the estimates from the fixed-effect-only model */
proc nlmixed data=rats;
   parms s1=.05 s2=1 / data=PE;   /* read in initial values for t1, t2 */
   eta = x1*t1 + x2*t2 + alpha;
   p   = probnorm(eta);
   model x ~ binomial(m,p);
   random alpha ~ normal(0,x1*s1*s1+x2*s2*s2) subject=litter;
run;

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

For the most help, please provide sample code and sample data for your questions.

 

If I understand your questions, the answer is "yes." You can first compute the parameter estimates for a fixed-effect model and then use those estimates as starting values for a random effects model. For example, the PROC NLMIXED documentation contains data and an example of a random-effects model for the size of a rat litter.  If you ignore the random effect and replace that effect with 0 (its mean value), then the fixed effect model is as follows:

 

proc nlmixed data=rats;
   parms t1=1 t2=1;
   eta = x1*t1 + x2*t2;
   p   = probnorm(eta);
   model x ~ binomial(m,p);
   ods output ParameterEstimates = PE;
run;

Notice that the ODS OUTPUT statement saves the parameter estimates to a data set.  For the full random-effect model, you can use the DATA= option on the PARMS statement to read in the estimates from the fixed-effect model:

 

/* full random-effects model. The starting values for the fixed effects
   are the estimates from the fixed-effect-only model */
proc nlmixed data=rats;
   parms s1=.05 s2=1 / data=PE;   /* read in initial values for t1, t2 */
   eta = x1*t1 + x2*t2 + alpha;
   p   = probnorm(eta);
   model x ~ binomial(m,p);
   random alpha ~ normal(0,x1*s1*s1+x2*s2*s2) subject=litter;
run;
johamunoza0
Fluorite | Level 6

Dear Rick 

Thank you so much, it is exactly what i need it.

Have a nice day, 

Johanna

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1857 views
  • 1 like
  • 2 in conversation