《HLM软件操作简介.ppt》由会员分享,可在线阅读,更多相关《HLM软件操作简介.ppt(55页珍藏版)》请在三一办公上搜索。
1、HLM6 软件操作,中国人民大学统计学院陈堰平,分层线性模型(Hierarchical linear Model,简称 HLM,又称多层线性模型,Multilevel Linear Model),HLM6.0 是分层线性模型软件,包含线性和非线性部分,可以读取大部份统计软件的数据如 SPSS,SAS,SYSTAT及STATA等等。HLM常用于社会科学和行为科学,因为它常有嵌套结构(Nested Structure)的数据,因此需用次模型(Sub-Model)或分层线性模型(Hierarchical Model),HLM就是设计来专门解决此类问题的,HLM提供的模型包括2-level model
2、s、3-level models、Hierarchical Generalized Linear Models(HGLM)和Hierarchical Multivariate Linear Models(HMLM)等。,HLM6 的五个模块,The HLM program encompasses 5 modules that may be used to fit different types of models:The HLM2 module is used to fit two-level linear and non-linear(HGLM)models.It offers the wi
3、dest array of special features,output,and hypothesis testing options.The HLM3 module is used to fit three-level linear and non-linear(HGLM)models.The range of features are similar to that of HLM2.,The HMLM module allows estimation of multivariate normal models from incomplete data.Within the framewo
4、rk of HMLM,it is possible to estimate models having An unrestricted covariance structure,that is a full covariance matrix.A model with homogenous level-1 variance and random intercepts and/or slopes at level-2.A model with heterogeneous variances at level 1(a different variance for each occasion)and
5、 random intercepts and/or slopes at level 2.A model that includes a log-linear structure for the level-1 variance and random intercepts and/or slopes at level 2.A model with first-order auto-regressive level-1 random errors and random intercepts and/or slopes at level 2.,HMLM2 allows for study of mu
6、ltivariate outcomes for persons who are,in turn,nested within higher-level units and offers similar modeling features as HMLM.The HCM2 module is used for two-level cross-classified random effects models,where lower-level units are cross-classified by two higher-level units.,原始数据的格式:SPSS、ASCII、SAS、SY
7、STAT学生版的限制:对于两层模型,层1最多7200条观测,层2最多350条观测对于三层模型,层1、2、3最多只能有7500、1700、60条观测每层不能超过5个效应(Effects),效应的总数不能超过25个下载地址:,主要内容,两层模型三层模型分层广义线性模型(HGLM)分层多元线性模型(HMLM)HLM6的作图功能,一、两层模型,对于ASCII格式的数据,ID变量必须是字符型,对于其它格式,可以是字符或数值型层一数据必须以层二单元ID分组,并在导入HLM前排序如果ID是数值型,范围必须在 到 之间。如果是浮点数,则小数部分被忽略字符型的ID不能超过12位。给定层的ID必须一样宽度,关于I
8、D变量(P17),Hierarchical Linear Models 第四章,实例讲解,层2数据,层1数据,指定层1变量,指定层2变量,保存MDM模板生成MDM文件查看MDM的统计量,MDM的描述统计量,选择层1的结果变量,无条件模型,bold 黑体:按总平均数对中bold italic 黑斜体:按层-2平均数(组平均数)对中,对中方式,填加层1解释变量,In the level-2 model,both the intercept and SES slope are to be modeled as dependent on the schools mean social class(ME
9、ANSES)and school sector(SECTOR).,填加层2的解释变量,混合模型,Using level subscripts,指定层1系数为随机的或非随机的,结果分析(与课本82页表4.5比较),基本设置,层1的残差数据,层2的残差数据,手册P3646结合SPSS的描述统计和统计图功能层1残差的分析层2残差的分析,残差分析,层1模型在生成MDM文件时逐条删除在分析时逐条删除analysis of multiply-imputed data(Section 9.2)层2模型,因假设是完全的,如果有缺失 impute a value删除 methods described in S
10、ection 9.2,确实数据的处理(P4648),其他设置,收敛的控制(P49),Estimation control,To put constraints on fixed effects,层1异方差建模,假设检验,Models without a level-1 intercept Coefficients having a random effect with no corresponding fixed effect,二、三层模型,数据是课本第八章,Data input requires a level-1 file(in our illustration a time-series data file),a level-2 file(child-level file),and a level-3(school level)file,三、分层广义线性模型(HGLM),示例数据ExamplesChapter6THAIU1.HLM,Thank You!,