Programming the statistical procedures from SAS

Automatically set start values in nlmixed

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Automatically set start values in nlmixed

[ Edited ]

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


Accepted Solutions
Solution
4 weeks ago
SAS Super FREQ
Posts: 4,239

Re: Automatically set start values in nlmixed

Posted in reply to johamunoza0

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


All Replies
Solution
4 weeks ago
SAS Super FREQ
Posts: 4,239

Re: Automatically set start values in nlmixed

Posted in reply to johamunoza0

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;
New Contributor
Posts: 4

Re: Automatically set start values in nlmixed

Dear Rick 

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

Have a nice day, 

Johanna

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 108 views
  • 1 like
  • 2 in conversation