BookmarkSubscribeRSS Feed
marcioadg
Calcite | Level 5

Hi,

To add a covariate to NLMIXED, is this as simple as to add to a GLIMMIX model for example?

Thanks,

Marcio

1 REPLY 1
plf515
Lapis Lazuli | Level 10

Nothing in NLMIXED is as simple as it is in GLIMMIX.  However, the NLMIXED documentation provides examples of models with covariates. See e.g. SAS/STAT(R) 9.2 User's Guide, Second Edition  where they give this code for a model with several covariates:

proc nlmixed data=inhaler corr ecorr;

  parms b0=0 b1=0 b2=0 b3=0 sd=1 i1=1 i2=1;

  bounds i1 > 0, i2 > 0;

  eta = b0 + b1*group + b2*time + b3*gt + u;

  if (clarity=1) then p = probnorm(-eta);

  else if (clarity=2) then

  p = probnorm(i1-eta) - probnorm(-eta);

  else if (clarity=3) then

  p = probnorm(i1+i2-eta) - probnorm(i1-eta);

  else p = 1 - probnorm(i1+i2-eta);

  if (p > 1e-8) then ll = log(p);

  else ll = -1e100;

  model clarity ~ general(ll);

  random u ~ normal(0,sd*sd) subject=sub;

  replicate freq;

  estimate 'thresh2' i1;

  estimate 'thresh3' i1 + i2;

  estimate 'icc' sd*sd/(1+sd*sd);

  run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1604 views
  • 0 likes
  • 2 in conversation