![]() | ![]() | ![]() | ![]() | ![]() |
| Contents: | Purpose / History / Requirements / Usage / Details / Limitations / References |
Initial coding 01Jun92
A few changes and additions 09Oct92
Corrections from Dale McLerran, FHCRC 16Feb94
Suggestions from David Murray, U. Minnesota 21Sep95
Suggestions from Ken Goldberg, Wyeth-Ayerst 27Oct95
Various minor updates 06Apr96
Per suggestions from Ken Goldberg, INITIAL
option changed, INTERCEPT= option dropped,
and FITTING, NOPREV, and NOTEST options
added. 12Mar97
More Goldberg ideas: NOTES option added,
PARMS specification is only used in the
first iteration unless you also specify
NOPREV, some clean up 19May97
7.01 conversion 01Jul97
Switched XBETA= and PRED= 14Nov97
Save spatial coordinates as suggested by
Michael O'Kelly, Quintiles Dublin 01Dec97
Eliminated LSMEANS / OM check 05Dec97
Titling code from Dale McLerran, FHCRC 20Feb98
Made PRINTLAST and FITTING the default 25Mar98
Fixed problem with TYPE=SP(EXP) 30Apr98
Allowed METHOD=MIVQUE0 to persist as
suggested by Svetlana Rudnaya, Ford 14Aug98
Changed output data set as suggested
by Carol Gotway-Crawford, CDC 25Sep98
Improved vertical bar processing as suggested
by Julie Yee, USGS, and Oliver
Schabenberger, Va Tech 26Apr02
Added terms to deviance calculation for Poisson
and Gamma distribution that do not sum to
zero for no-intercept models and with certain
repeated structures. The OLDDEVIANCE option
uses the previous formulas 06Jun02
%inc "<location of your file containing the GLIMMIX macro>";
Following this statement, you may call the %GLIMMIX macro. See the Results tab for examples.
In addition to variable names beginning with an underscore, the following are reserved variable names and should not be used in your input SAS data set:
The following options can be specified:
data= specifies the data set you are using. It can either
be a regular input data set or the _DS data set
from a previous call to %GLIMMIX. The latter is used
to specify starting values for %GLIMMIX and should be
accompanied by the INITIAL= option described below.
procopt= specifies options appropriate for a PROC
MIXED statement. Refer to the PROC MIXED
documentation for more information.
stmts= specifies PROC MIXED statements for the analysis,
separated by semicolons and listed as a single
argument to the %str() macro function. Statements
may include any of the following: CLASS, MODEL,
RANDOM, REPEATED, PARMS, ID, CONTRAST, ESTIMATE,
and LSMEANS. Syntax and options for each
statement are exactly as in the PROC MIXED
documentation. If you wish to use the OM option
with the LSMEANS statement, you should specify
OM=dataset to avoid conflicts with weights.
weight= specifies a weighting variable for the analysis
This allows you to construct your own weights
which can modify or replace the ones constructed
by %GLIMMIX.
freq= specifies a frequency variable for the analysis.
It replicates observations with the number of
replicates being equal to the value of the FREQ
variable.
error= specifies the error distribution. Valid types are:
binomial|b, normal|n, poisson|p, gamma|g,
invgaussian|ig, and user|u
When you specify error=user, you must also provide
the errvar= and errdev= options. The default
error distribution is binomial.
errvar= specifies the user-defined variance function. It
must be expressed as a function the argument "mu"
(see examples).
errdev= specifies the user-defined deviance function. It
must be expressed as a function the arguments
"_y", which is the response variable, and "mu",
which is the mean. You are allowed to use "_wght"
also, which corresponds to the denominator of a
binomial response. Typical deviance functions are
as follows:
normal (_y-mu)**2
poisson 2*_y*log(_y/mu);
binomial 2*_wght*(_y*log(_y/mu)+
(1-_y)*log((1-_y)/(1-mu)))
gamma -2*log(_y/mu)
invgaussian (((_y-mu)**2)/(_y*mu*mu))
The default deviance is binomial.
link= specifies the link function. Valid types are
logit, probit, cloglog, loglog, identity,
power(), log, exp, reciprocal, nlin, and user.
(warning: nlin has not been tested, and it currently
uses an MQL-type estimation scheme.)
When you specify link=nlin, you must also provide
the linkn=, linknd=, and linkni= options. When
you specify link=user, you must also provide the
ulink=, dulink=, and iulink= options. The default
link is different for each error distribution and
is as follows:
Distribution Default Link
------------ ------------
Binomial Logit
Poisson Log
Normal Identity
Gamma Reciprocal
Invgaussian Power(-2)
linkn= specifies a nonlinear link function. It must be
enclosed in %str() and assign a value to "mu" by
using parameters "b1" - "bk".
linknd= specifies the derivative of the nonlinear link
function.
linkni= specifies the initial values for the nonlinear
link function.
linku= specifies a user-defined link function. It must
be expressed as a function with the argument "mu".
linkud= specifies the derivative of the user-defined link
function with respect to mu. It must be expressed
as a function with argument "mu". For an
approximation, use the formula
(u(mu+h)-u(mu-h))/(2*h)
where u() is the link and h is a small number.
linkui= specifies the inverse of the user-defined link.
It must be expressed as a function with argument
"eta".
linkuid= specifies the derivative of the inverse of the
user-defined link. It must be expressed as a function
with argument "eta".
numder= specifies the tolerance used to numerically differentiate
certain link functions (e.g. probit and power). It has
a default value of 1e-5.
cf= specifies the correction factor added to the data
in order to avoid singularities in the initial
iteration. It has a default value of 0.5.
converge=sets the convergence criterion for the %GLIMMIX
macro. This is not the convergence criteria used
for each internal PROC MIXED call, but rather the
criterion used to assess convergence of the entire
macro algorithm. It has a default value of 1e-8.
maxit= specifies the maximum number of iterations for the
%GLIMMIX macro to converge. It has a default value of
20.
offset= specifies an offset variable. By default no offset
is used.
zmult= (available only in %GLIMMIX for Version 8 or later)
specifies a variable by which the pseudo data variable
_z is multiplied during each iteration.
wadd= (available only in %GLIMMIX for Version 8 or later)
specifies a variable to add to the weight variable _w
during each iteration.
out= specifies a name for an output data set. This data
set is the predicted value data set from PROC MIXED with
the following additional variables:
eta = linear predictor (xbeta) + offset
stderreta = approximate std err of eta
lowereta = lower confidence limit for eta
uppereta = upper confidence limit for eta
mu = inverse link transform of eta
dmu = derivative of mu with respect to eta
stderrmu = approx std err of mu via delta method
lowermu = lower cl for mu, inv link transform of lowereta
uppermu = upper cl for mu, inv link transform of uppereta
var = variance
resraw = raw residual, y - mu
reschi = scaled residual, (y-mu)/sqrt(phi*var)
deta = derivative of eta with respect to mu
_w = weight used in final PROC MIXED call
_z = dependent variable used in final PROC MIXED call
If none is given, then a default name
of _OUTFILE is used.
outalpha=specifies an alpha level for the confidence limits
in the out= data set.
options= specifies %GLIMMIX macro options separated by
spaces:
FITTING (available only in %GLIMMIX for Version 6)
prints the model fitting information from
the final PROC MIXED run.
INITIAL specifes that the input data set is actually
the _DS data set from a previous call to
%GLIMMIX. This allows you to restart a
problem that stopped or to specify starting
values.
MQL computes MQL estimates (see Breslow and
Clayton, 1993). The default
is PQL with an extra-dispersion
parameter.
NOPREV prevents use of previous covariance parameter
estimates as starting values for the next
iteration.
NOPRINT suppresses all printing.
NOITPRINT suppresses printing of the iteration
history.
NOTES requests printing of SAS notes, date, and page
numbers during macro execution. By default,
the notes, date, and numbers are turned off
during macro execution and turned back on after
completion.
OLDDEVIANCE (available only in %GLIMMIX for Version 8 or later)
requests computation of deviances for poisson and
gamma distribution as in earlier versions of %GLIMMIX
(up to June 02).
PRINTALL prints all PROC MIXED runs.
PRINTDATA prints the pseudo data after each
iteration.
PRINTLAST (available only in %GLIMMIX for Version 6)
prints the final PROC MIXED run.
By default, %GLIMMIX uses restricted/residual psuedo likelihood (REPL) to find the parameter estimates of the generalized linear mixed model you specify. The macro calls PROC MIXED iteratively until convergence, which is decided using the relative deviation of the variance/covariance parameter estimates. An extra-dispersion scale parameter is estimated by default.
%GLIMMIX will work on any type of model with the error distributions and link functions given in the ERRLINK macro. In addition, you can specify your own error and/or link functions. In order to do this you must specify the error=user and/or link=user options in conjunction with the errvar=, errdev=, linku=, linkud=, linkui=, and linkuid= options.
McCullagh, P. and Nelder, J.A. (1989), Generalized Linear Models, Second Edition, London: Chapman and Hall.
Wolfinger, R. and O'Connell, M. (1993), "Generalized Linear Mixed Models: A Pseudo-Likelihood Approach," Journal of Statistical Computation and Simulation, 48.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
NOTE: The following examples and results used the %GLIMMIX macro for Version 8 or later.
data salaman;
input day fpop$ fnum mpop$ mnum y1 y2 y3;
datalines;
4 rb 1 rb 1 1 1 1
4 rb 2 rb 5 1 1 0
4 rb 3 rb 2 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b 5 1 0 0
24 ws 8 rb 3 0 0 0
24 ws 9 rb 4 0 1 0
24 ws 10 rb 2 0 0 0
run;
/*---1st experiment---*/
data sal1;
set salaman;
y = y1;
expt = 1;
run;
/* Define the GLIMMIX macro */
%inc "<location of your file containing the GLIMMIX macro>";
/*---logistic regression with random effects---*/
%glimmix(data=sal1,
stmts=%str(
class fpop fnum mpop mnum;
model y = fpop|mpop / solution;
random fpop*fnum mpop*mnum;
lsmeans fpop*mpop / cl diff;
),
error=binomial
)
run;
The GLIMMIX Macro
Data Set : WORK.SAL1
Error Distribution : BINOMIAL
Link Function : LOGIT
Response Variable : Y
GLIMMIX Iteration History
Iteration Convergence criterion
1 1.0301877779
2 0.3698874839
3 0.1110022646
4 0.019645527
5 0.0024043459
6 0.0002225154
7 4.1481413E-6
8 1.636125E-10
Output from final Proc Mixed run:
The Mixed Procedure
Model Information
Data Set WORK._DS
Dependent Variable _z
Weight Variable _w
Covariance Structure Variance Components
Estimation Method REML
Residual Variance Method Profile
Fixed Effects SE Method Model-Based
Degrees of Freedom Method Containment
Class Level Information
Class Levels Values
fpop 2 rb ws
fnum 10 1 2 3 4 5 6 7 8 9 10
mpop 2 rb ws
mnum 10 1 2 3 4 5 6 7 8 9 10
Dimensions
Covariance Parameters 3
Columns in X 9
Columns in Z 40
Subjects 1
Max Obs Per Subject 120
Number of Observations
Number of Observations Read 120
Number of Observations Used 120
Number of Observations Not Used 0
Parameter Search
CovP1 CovP2 CovP3 Variance Res Log Like -2 Res Log Like
2.0201 0.6318 0.6644 0.6644 -284.4640 568.9280
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
1 1 568.92797414 0.00000000
Convergence criteria met.
Covariance Parameter
Estimates
Cov Parm Estimate
fpop*fnum 2.0201
mpop*mnum 0.6318
Residual 0.6644
Fit Statistics
-2 Res Log Likelihood 568.9
AIC (smaller is better) 574.9
AICC (smaller is better) 575.1
BIC (smaller is better) 577.9
PARMS Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
2 0.00 1.0000
Solution for Fixed Effects
Standard
Effect fpop mpop Estimate Error DF t Value Pr > |t|
Intercept 1.1755 0.6513 17 1.80 0.0888
fpop rb -0.3200 0.8363 18 -0.38 0.7065
fpop ws 0 . . . .
mpop rb -2.8383 0.7177 17 -3.95 0.0010
mpop ws 0 . . . .
fpop*mpop rb rb 3.3477 0.8325 81 4.02 0.0001
fpop*mpop rb ws 0 . . . .
fpop*mpop ws rb 0 . . . .
fpop*mpop ws ws 0 . . . .
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
fpop 1 18 3.24 0.0887
mpop 1 17 4.60 0.0468
fpop*mpop 1 81 16.17 0.0001
Least Squares Means
Standard
Effect fpop mpop Estimate Error DF t Value Pr > |t| Alpha
fpop*mpop rb rb 1.3649 0.6623 81 2.06 0.0425 0.05
fpop*mpop rb ws 0.8556 0.6341 81 1.35 0.1810 0.05
fpop*mpop ws rb -1.6628 0.6765 81 -2.46 0.0161 0.05
fpop*mpop ws ws 1.1755 0.6513 81 1.80 0.0748 0.05
Least Squares Means
Effect fpop mpop Lower Upper
fpop*mpop rb rb 0.04711 2.6828
fpop*mpop rb ws -0.4061 2.1172
fpop*mpop ws rb -3.0089 -0.3167
fpop*mpop ws ws -0.1203 2.4714
Differences of Least Squares Means
Standard
Effect fpop mpop _fpop _mpop Estimate Error DF t Value Pr > |t|
fpop*mpop rb rb rb ws 0.5094 0.6494 81 0.78 0.4351
fpop*mpop rb rb ws rb 3.0278 0.8827 81 3.43 0.0010
fpop*mpop rb rb ws ws 0.1894 0.9289 81 0.20 0.8389
fpop*mpop rb ws ws rb 2.5184 0.9270 81 2.72 0.0081
fpop*mpop rb ws ws ws -0.3200 0.8363 81 -0.38 0.7030
fpop*mpop ws rb ws ws -2.8383 0.7177 81 -3.95 0.0002
Differences of Least Squares Means
Effect fpop mpop _fpop _mpop Alpha Lower Upper
fpop*mpop rb rb rb ws 0.05 -0.7827 1.8015
fpop*mpop rb rb ws rb 0.05 1.2715 4.7840
fpop*mpop rb rb ws ws 0.05 -1.6587 2.0376
fpop*mpop rb ws ws rb 0.05 0.6740 4.3627
fpop*mpop rb ws ws ws 0.05 -1.9839 1.3439
fpop*mpop ws rb ws ws 0.05 -4.2663 -1.4104
GLIMMIX Model Statistics
Description Value
Deviance 85.2361
Scaled Deviance 128.2962
Pearson Chi-Square 63.5935
Scaled Pearson Chi-Square 95.7201
Extra-Dispersion Scale 0.6644
data bin;
seed = 78080347;
n = 1;
do k = 1 to 100;
bb = rannor(seed);
do l = 1 to 7;
eta = -2.1972246 + bb;
p = exp(eta)/(1 + exp(eta));
y = ranbin(seed,n,p);
output;
end;
end;
drop seed l;
run;
/* Define the GLIMMIX macro */
%inc "<location of your file containing the GLIMMIX macro>";
/*---PQL analysis---*/
%glimmix(data=bin,
procopt=noprofile,
stmts=%str(
class k;
model y/n = / cl;
random int / sub=k;
parms (0.2) (1) / eqcons=2;
)
)
run;
The GLIMMIX Macro
Data Set : WORK.BIN
Error Distribution : BINOMIAL
Link Function : LOGIT
Response Variable : Y/N
GLIMMIX Iteration History
Iteration Convergence criterion
1 2
2 0.4629372605
3 0.0357933422
4 0.006966794
5 0.0004458137
6 8.536141E-10
Output from final Proc Mixed run:
The Mixed Procedure
Model Information
Data Set WORK._DS
Dependent Variable _z
Weight Variable _w
Covariance Structure Variance Components
Subject Effect k
Estimation Method REML
Residual Variance Method Parameter
Fixed Effects SE Method Model-Based
Degrees of Freedom Method Containment
Class Level Information
Class Levels Values
k 100 1 2 3 4 5 6 7 8 9 10 11 12 13
14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 40 41 42 43
44 45 46 47 48 49 50 51 52 53
54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73
74 75 76 77 78 79 80 81 82 83
84 85 86 87 88 89 90 91 92 93
94 95 96 97 98 99 100
Dimensions
Covariance Parameters 2
Columns in X 1
Columns in Z Per Subject 1
Subjects 100
Max Obs Per Subject 7
Number of Observations
Number of Observations Read 700
Number of Observations Used 700
Number of Observations Not Used 0
Parameter Search
CovP1 CovP2 Res Log Like -2 Res Log Like
0.2118 1.0000 -1724.5749 3449.1498
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
1 1 3449.14983271 0.00000000
Convergence criteria met.
Covariance Parameter Estimates
Cov Parm Subject Estimate
Intercept k 0.2118
Residual 1.0000
Fit Statistics
-2 Res Log Likelihood 3449.1
AIC (smaller is better) 3451.1
AICC (smaller is better) 3451.2
BIC (smaller is better) 3453.8
PARMS Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
1 0.00 1.0000
Solution for Fixed Effects
Standard
Effect Estimate Error DF t Value Pr > |t| Alpha
Intercept -1.8873 0.1208 99 -15.62 <.0001 0.05
Solution for Fixed Effects
Effect Lower Upper
Intercept -2.1270 -1.6476
GLIMMIX Model Statistics
Description Value
Deviance 517.1315
Scaled Deviance 517.1315
Pearson Chi-Square 609.0697
Scaled Pearson Chi-Square 609.0697
Extra-Dispersion Scale 1.0000
data ship;
length type $1. year $7. period $8.;
input type year period service y;
datalines;
B 1965-69 1975-79 9.9218 53
C 1965-69 1975-79 6.5162 1
D 1965-69 1975-79 5.2575 0
E 1965-69 1975-79 6.0799 7
A 1965-69 1975-79 6.9985 4
A 1965-69 1960-74 6.9985 3
B 1965-69 1960-74 10.2615 58
C 1965-69 1960-74 6.6606 0
D 1965-69 1960-74 5.6630 0
E 1965-69 1960-74 6.6708 7
A 1970-64 1960-74 7.3212 6
B 1970-64 1960-74 8.8628 12
C 1970-64 1960-74 6.6631 6
D 1970-64 1960-74 5.8551 2
E 1970-64 1960-74 7.0536 5
A 1970-64 1975-79 8.1176 18
B 1970-64 1975-79 9.4803 44
C 1970-64 1975-79 7.5746 2
D 1970-64 1975-79 7.0967 11
E 1970-64 1975-79 7.6783 12
A 1975-69 1975-79 7.7160 11
B 1975-69 1975-79 8.8702 18
C 1975-69 1975-79 5.6131 1
D 1975-69 1975-79 7.6261 4
E 1975-69 1975-79 6.2953 1
A 1960-64 1960-74 4.8442 0
B 1960-64 1960-74 10.7118 39
C 1960-64 1960-74 7.0724 1
D 1960-64 1960-74 5.5255 0
E 1960-64 1960-74 3.8067 0
A 1960-64 1975-79 4.1431 0
B 1960-64 1975-79 9.7513 29
C 1960-64 1975-79 6.3135 1
D 1960-64 1975-79 4.6540 0
run;
/* Define the GLIMMIX macro */
%inc "<location of your file containing the GLIMMIX macro>";
/*---poisson regression (log-linear model) with random effects,
parameterization for TYPE matches McCullagh and Nelder's---*/
%glimmix(data=ship,
procopt=order=data,
stmts=%str(
class type year period;
model y = type / solution;
random year|period;
estimate 'E vs. Others' type -1 -1 -1 4 -1 / divisor=4 cl;
),
error=poisson,
link=log,
offset=service
)
run;
The GLIMMIX Macro
Data Set : WORK.SHIP
Error Distribution : POISSON
Link Function : LOG
Response Variable : Y
GLIMMIX Iteration History
Iteration Convergence criterion
1 2
2 0.2090120075
3 0.0377717984
4 0.0012833596
5 1.5332658E-6
6 1.0416946E-9
Output from final Proc Mixed run:
The Mixed Procedure
Model Information
Data Set WORK._DS
Dependent Variable _z
Weight Variable _w
Covariance Structure Variance Components
Estimation Method REML
Residual Variance Method Profile
Fixed Effects SE Method Model-Based
Degrees of Freedom Method Containment
Class Level Information
Class Levels Values
type 5 B C D E A
year 4 1965-69 1970-64 1975-69
1960-64
period 2 1975-79 1960-74
Dimensions
Covariance Parameters 4
Columns in X 6
Columns in Z 13
Subjects 1
Max Obs Per Subject 34
Number of Observations
Number of Observations Read 34
Number of Observations Used 34
Number of Observations Not Used 0
Parameter Search
CovP1 CovP2 CovP3 CovP4 Variance Res Log Like
0.1174 0.07066 0 1.6702 1.6702 -41.1538
Parameter
Search
-2 Res Log Like
82.3076
Iteration History
Iteration Evaluations -2 Res Log Like Criterion
1 1 82.30761547 0.00000000
Convergence criteria met.
Covariance Parameter
Estimates
Cov Parm Estimate
year 0.1174
period 0.07066
year*period 0
Residual 1.6702
Fit Statistics
-2 Res Log Likelihood 82.3
AIC (smaller is better) 88.3
AICC (smaller is better) 89.3
BIC (smaller is better) 86.5
PARMS Model Likelihood Ratio Test
DF Chi-Square Pr > ChiSq
2 0.00 1.0000
Solution for Fixed Effects
Standard
Effect type Estimate Error DF t Value Pr > |t|
Intercept -5.6799 0.3286 1 -17.28 0.0368
type B -0.5798 0.2277 23 -2.55 0.0180
type C -0.6984 0.4248 23 -1.64 0.1138
type D -0.08703 0.3746 23 -0.23 0.8183
type E 0.3301 0.3046 23 1.08 0.2897
type A 0 . . . .
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
type 4 23 4.38 0.0089
Estimates
Standard
Label Estimate Error DF t Value Pr > |t| Alpha
E VS. OTHERS 0.6714 0.2675 23 2.51 0.0196 0.05
Estimates
Label Lower Upper
E VS. OTHERS 0.1180 1.2249
GLIMMIX Model Statistics
Description Value
Deviance 39.5309
Scaled Deviance 23.6678
Pearson Chi-Square 42.9235
Scaled Pearson Chi-Square 25.6990
Extra-Dispersion Scale 1.6702
Right-click on the appropriate link below and select Save to save
the %GLIMMIX macro definition
to a file. It is recommended that you name the file
glimmix.sas.
Download and save %GLIMMIX for Version 8 or later.
Download and save %GLIMMIX for Version 6.12.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> MIXED |
| Date Modified: | 2007-08-14 03:03:10 |
| Date Created: | 2005-01-17 08:28:25 |
| Product Family | Product | Host | SAS Release | |
| Starting | Ending | |||
| SAS System | SAS/STAT | All | 6.12 | n/a |




