Upload
teigra
View
120
Download
10
Embed Size (px)
DESCRIPTION
第三章 混合模型的纵向数据分析. 线性模型 分成数据的混合模型. 纵向数据( Longitudinal Data )的混合模型. 这里 是协方差矩阵,即 的元素不需要独立. 的选取. 常见的是和时间有关,如 中的元素服从时间序列模型,自回归模型,滑动平均模型等,并有周期。 例如模型. 对于 AR ( 1 ). AR ( 1 )简介. 令 其中 独立。 假设 则时间序列平稳且 - PowerPoint PPT Presentation
Citation preview
第三章 混合模型的纵向数据分析
线性模型 分成数据的混合模型
这里 是协方差矩阵,即 的元素不需要独立
纵向数据( Longitudinal Data )的混合模型
常见的是和时间有关,如 中的元素服从时间序列模型,自回归模型,滑动平均模型等,并有周期。
例如模型
的选取
对于 AR ( 1 )
令 其中 独立。 假设 则时间序列平稳且
时间序列有单位根即 。
AR ( 1 )简介
令 和 为给定 t-1 时刻前的条件期望和方差,则
因此
AR ( 1 )模型的数值特征
均值方差为
分布为
无条件期望方差
定义
协方差
相关系数 因为
自相关系数
协方差
d 阶自相关系数
d 阶自相关系数
对于 ARMA ( 1,1 )
模型 其中
一般形式 其中
ARMA ( 1,1 )简介
假设
其中 ,
ARMA(1,1) 另一种形式为
自协方差函数
其中
MA( )
方差
方差
自协方差函数
自相关系数
第一层模型
分层模型
第二层模型
混合模型
截距项 组间(时间不变) 组内(时变的) 交互
说明
记为
其中
4 个组群,随机部分
随机部分方差
模型的矩阵形式 1
这里
矩阵形式 2
矩阵形式 3
矩阵形式 4
广义最小二乘( GLS )
极大似然估计,同时估计 , 采用 anova 函数 , 其中 为固定效应 , 为随机效应 , 常被低估 .
限制的极大似然估计,先估计 然后采用 GLS 估计 ,采用函数 lme, 更精确
两种估计算法
程序
数据集描述(畸齿矫, orthodontics ) Investigators at the University of
North Carolina Dental School followed the growth of 27 children (16 males, 11 females) from age 8 until age 14. Every two years they measured the distance between the pituitary (脑垂体,脑下腺) and the pterygomaxillary fissure (翼上颌列)(单位 mm ) , two points that are easily identified on x-ray exposures of the side of the head.
数据续 distance a numeric vector of
distances from the pituitary to the pterygomaxillary fissure (mm). These distances are measured on x-ray images of the skull.
age a numeric vector of ages of the subject (yr).
Subject an ordered factor indicating the subject on which the measurement was made. The levels are labelled M01 to M16 for the males and F01 to F13 for the females. The ordering is by increasing average distance within sex.
Sex a factor with levels Male and Female
文献 Pinheiro, J. C. and Bates, D. M.
(2000), Mixed-Effects Models in S and S-PLUS, Springer, New York. (Appendix A.17)
Potthoff, R. F. and Roy, S. N. (1964), “A generalized multivariate analysis of variance model useful especially for growth curve problems”, Biometrika, 51, 313–326.
数据预处理 plot(dd) tab(dd,~Sex) fit1<-lm(distance~age*Sex,dd) summary(fit) wald(fit,"Sex") fit2<-lm(distance~age+Sex,dd) summary(fit2) fit3<-lm(distance~age/Sex,dd) summary(fit3)
混合效应模型 fit<-
lme(distance~age*Sex,dd,random=~1+age|Subject,correlation=corAR1(form=~1|Subject))
summary(fit) intervals(fit)# 区间估计 getVarCov(fit)# 得到 G 矩阵
去掉 Sex 主效应 fit1<-lme(distance~age/
Sex,dd,random=~1+age|Subject,correlation=corAR1(form=~1|Subject))
summary(fit1) intervals(fit1)# 区间估计 getVarCov(fit1)#G 矩阵
去掉异常数据 fit.dropM09<-
update(fit,subset=Subject!="M09")
summary(fit.dropM09)
intervals(fit.dropM09)
去掉异常数据 2
fit1.dropM09<-update(fit1,subset=Subject!="M09")
summary(fit1.dropM09)
intervals(fit1.dropM09)
Wald 检验 L=rbind("Male at
14"=c(1,14,0,0),"Female at 14"=c(1,14,1,14))
wald(fit,L) L1=rbind("Male at
14"=c(1,14,0),"Female at 14"=c(1,14,14))
wald(fit1,L1)
Wald 检验 2
L.gap<-rbind("Gap at 12"=c(0,0,1,12))
wald(fit,L.gap) wald(fit,"Sex") L1.gap<-rbind("Gap at
12"=c(0,0,12)) wald(fit1,L1.gap) wald(fit1,"Sex")
一些模型总结 令 X 为组内因子(时变), W 为组间因子
(时间不变)
一因子混合模型 第一层
第二层
合并
条件方差和无条件方差 条件方差
无条件方差
的估计, 的加权平均 定义
估计值为
一般结构
条件方差
估计的期望
方差
EBLUPs(Empirical Best Linear Unbiased Predictor) 最佳线性预测 BLUP
EBLUP of
OLS 估计
方差 分布的均值为 0 方差为
EBLUP
最佳线形无偏估计( BLUPS ) Best linear unbiased predictor
estimate OLS
HLM
BLUP
EBLUP
Empirical BLUP ( 经验最佳线型无偏估计 )
一些方差结论