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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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