|
Chapter Contents |
Previous |
Next |
| The NLMIXED Procedure |
data rats;
input trt$ m x;
if (trt='c') then do;
x1 = 1;
x2 = 0;
end;
else do;
x1 = 0;
x2 = 1;
end;
litter = _n_;
datalines;
c 13 13
c 12 12
c 9 9
c 9 9
c 8 8
c 8 8
c 13 12
c 12 11
c 10 9
c 10 9
c 9 8
c 13 11
c 5 4
c 7 5
c 10 7
c 10 7
t 12 12
t 11 11
t 10 10
t 9 9
t 11 10
t 10 9
t 10 9
t 9 8
t 9 8
t 5 4
t 9 7
t 7 4
t 10 5
t 6 3
t 10 3
t 7 0
run;
Here, M represents the size of the litter after 4 days, and X represents the size of the litter after 21 days. Also, indicator variables X1 and X2 are constructed for the two treatment levels.
Following McCulloch (1994), assume a latent survival model of the form

Instead of observing the survival times yijk, assume that only the binary variable indicating whether yijk exceeds 0 is observed. If xij denotes the sum of these binary variables for the ith treatment and the jth litter, then the preceding assumptions lead to the following generalized linear mixed model:


The PROC NLMIXED statements to fit this model are as follows.
proc nlmixed data=rats;
parms t1=1 t2=1 s1=.05 s2=1;
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;
estimate 'gamma2' t2/sqrt(1+s2*s2);
predict p out=p;
run;
As in the previous example, the PROC NLMIXED statement invokes the procedure and the PARMS statement defines the parameters. The parameters for this example are the two treatment means, T1 and T2, and the two random-effect standard deviations, S1 and S2.
The indicator variables X1 and X2 are used in the program to assign the proper mean to each observation in the input data set as well as the proper variance to the random effects. Note that programming expressions are permitted inside the distributional specifications, as illustrated by the random-effects variance specified here.
The ESTIMATE statement requests an estimate of
, which is a location-scale parameter from
Ochi and Prentice (1984).
The PREDICT statement constructs predictions for each observation in
the input data set. For this example, predictions of P and
approximate standard errors of prediction are output to a SAS
data set named P. These predictions are functions of the parameter
estimates and the empirical Bayes estimates of the random effects
.
The output for this model is as follows.
|
| |||||||||||||||||
|
| ||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||
Not shown is the P data set, which contains the original 32 observations and predictions of the pij.
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.