没有合适的资源?快使用搜索试试~ 我知道了~
首页SAS Mixed Procedure
SAS Mixed Procedure
需积分: 50 345 浏览量
更新于2023-05-23
评论 1
收藏 12.41MB PDF 举报
SAS Mixed Procedure 最新的SAS使用手册 15.1 全方位了解
资源详情
资源评论
资源推荐

SAS/STAT
®
15.1
User’s Guide
The MIXED Procedure

This document is an individual chapter from SAS/STAT
®
15.1 User’s Guide.
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2018. SAS/STAT
®
15.1 User’s Guide. Cary, NC:
SAS Institute Inc.
SAS/STAT
®
15.1 User’s Guide
Copyright © 2018, SAS Institute Inc., Cary, NC, USA
All Rights Reserved. Produced in the United States of America.
For a hard-copy book
: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by
any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute
Inc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time
you acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is
illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic
piracy of copyrighted materials. Your support of others’ rights is appreciated.
U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer software
developed at private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, or
disclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, as
applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR 227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S.
federal law, the minimum restricted rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision
serves as notice under clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The
Government’s rights in Software and documentation shall be only those set forth in this Agreement.
SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414
November 2018
SAS
®
and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the
USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
SAS software may be provided with certain third-party software, including but not limited to open-source software, which is
licensed under its applicable third-party software license agreement. For license information about third-party software distributed
with SAS software, refer to http://support.sas.com/thirdpartylicenses.

Chapter 81
The MIXED Procedure
Contents
Overview: MIXED Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6534
Basic Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6535
Notation for the Mixed Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6536
PROC MIXED Contrasted with Other SAS Procedures . . . . . . . . . . . . . . . . . 6537
Getting Started: MIXED Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6538
Clustered Data Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6538
Syntax: MIXED Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6544
PROC MIXED Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6546
BY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6558
CLASS Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6558
CODE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6559
CONTRAST Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6560
ESTIMATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6563
ID Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6565
LSMEANS Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6565
LSMESTIMATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6571
MODEL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6572
PARMS Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6586
PRIOR Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6589
RANDOM Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6594
REPEATED Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6598
SLICE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6612
STORE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6612
WEIGHT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6612
Details: MIXED Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6612
Mixed Models Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6612
Parameterization of Mixed Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 6625
Residuals and Influence Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . 6630
Default Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6637
ODS Table Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6641
ODS Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6646
Computational Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6651
Examples: MIXED Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6655
Example 81.1: Split-Plot Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6655
Example 81.2: Repeated Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . 6660
Example 81.3: Plotting the Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . 6671

6534 F Chapter 81: The MIXED Procedure
Example 81.4: Known G and R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6678
Example 81.5: Random Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . 6684
Example 81.6: Line-Source Sprinkler Irrigation . . . . . . . . . . . . . . . . . . . . . 6691
Example 81.7: Influence in Heterogeneous Variance Model . . . . . . . . . . . . . . 6696
Example 81.8: Influence Analysis for Repeated Measures Data . . . . . . . . . . . . 6705
Example 81.9: Examining Individual Test Components . . . . . . . . . . . . . . . . . 6714
Example 81.10: Isotonic Contrasts for Ordered Mean Values . . . . . . . . . . . . . . 6718
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6719
Overview: MIXED Procedure
The MIXED procedure fits a variety of mixed linear models to data and enables you to use these fitted models
to make statistical inferences about the data. A mixed linear model is a generalization of the standard linear
model used in the GLM procedure, the generalization being that the data are permitted to exhibit correlation
and nonconstant variability. The mixed linear model, therefore, provides you with the flexibility of modeling
not only the means of your data (as in the standard linear model) but their variances and covariances as well.
The primary assumptions underlying the analyses performed by PROC MIXED are as follows:
The data are normally distributed (Gaussian).
The means (expected values) of the data are linear in terms of a certain set of parameters.
The variances and covariances of the data are in terms of a different set of parameters, and they exhibit
a structure matching one of those available in PROC MIXED.
Since Gaussian data can be modeled entirely in terms of their means and variances/covariances, the two
sets of parameters in a mixed linear model actually specify the complete probability distribution of the data.
The parameters of the mean model are referred to as fixed-effects parameters, and the parameters of the
variance-covariance model are referred to as covariance parameters.
The fixed-effects parameters are associated with known explanatory variables, as in the standard linear model.
These variables can be either qualitative (as in the traditional analysis of variance) or quantitative (as in
standard linear regression). However, the covariance parameters are what distinguishes the mixed linear
model from the standard linear model.
The need for covariance parameters arises quite frequently in applications, the following being the two most
typical scenarios:
The experimental units on which the data are measured can be grouped into clusters, and the data from
a common cluster are correlated.
Repeated measurements are taken on the same experimental unit, and these repeated measurements are
correlated or exhibit variability that changes.

Basic Features F 6535
The first scenario can be generalized to include one set of clusters nested within another. For example,
if students are the experimental unit, they can be clustered into classes, which in turn can be clustered
into schools. Each level of this hierarchy can introduce an additional source of variability and correlation.
The second scenario occurs in longitudinal studies, where repeated measurements are taken over time.
Alternatively, the repeated measures could be spatial or multivariate in nature.
PROC MIXED provides a variety of covariance structures to handle the previous two scenarios. The most
common of these structures arises from the use of random-effects parameters, which are additional unknown
random variables assumed to affect the variability of the data. The variances of the random-effects parameters,
commonly known as variance components, become the covariance parameters for this particular structure.
Traditional mixed linear models contain both fixed- and random-effects parameters, and, in fact, it is the
combination of these two types of effects that led to the name mixed model. PROC MIXED fits not only
these traditional variance component models but numerous other covariance structures as well.
PROC MIXED fits the structure you select to the data by using the method of restricted maximum likelihood
(REML), also known as residual maximum likelihood. It is here that the Gaussian assumption for the data is
exploited. Other estimation methods are also available, including maximum likelihood and MIVQUE0. The
details behind these estimation methods are discussed in subsequent sections.
After a model has been fit to your data, you can use it to draw statistical inferences via both the fixed-effects
and covariance parameters. PROC MIXED computes several different statistics suitable for generating
hypothesis tests and confidence intervals. The validity of these statistics depends upon the mean and variance-
covariance model you select, so it is important to choose the model carefully. Some of the output from PROC
MIXED helps you assess your model and compare it with others.
Basic Features
PROC MIXED provides easy accessibility to numerous mixed linear models that are useful in many common
statistical analyses. In the style of the GLM procedure, PROC MIXED fits the specified mixed linear model
and produces appropriate statistics.
Here are some basic features of PROC MIXED:
covariance structures, including variance components, compound symmetry, unstructured, AR(1),
Toeplitz, spatial, general linear, and factor analytic
GLM-type grammar, by using MODEL, RANDOM, and REPEATED statements for model specifica-
tion and CONTRAST, ESTIMATE, and LSMEANS statements for inferences
appropriate standard errors for all specified estimable linear combinations of fixed and random effects,
and corresponding t and F tests
subject and group effects that enable blocking and heterogeneity, respectively
REML and ML estimation methods implemented with a Newton-Raphson algorithm
capacity to handle unbalanced data
ability to create a SAS data set corresponding to any table
剩余212页未读,继续阅读














安全验证
文档复制为VIP权益,开通VIP直接复制

评论0