纵向数据混合回归模型

Download Report

Transcript 纵向数据混合回归模型

第三章 混合模型的纵向数据分
析
线性模型
 分成数据的混合模型

纵向数据(Longitudinal Data)的混
合模型

这里
是协方差矩阵,即
需要独立
的元素不
的选取
常见的是和时间有关,如 中的元素服从
时间序列模型,自回归模型,滑动平均模
型等,并有周期。
例如模型
对于AR(1)
AR(1)简介
令
独立。
 假设
其中


则时间序列平稳且
时间序列有单位根即
。
AR(1)模型的数值特征

令
和
件期望和方差,则

因此
为给定t-1时刻前的条
无条件期望方差

均值方差为

分布为
自相关系数

定义

协方差

相关系数
因为
d阶自相关系数


协方差
d阶自相关系数
对于ARMA(1,1)
ARMA(1,1)简介

模型

一般形式
其中
其中

假设

其中
,
MA( )

ARMA(1,1) 另一种形式为

自协方差函数
其中
方差

方差
自协方差函数
自相关系数
分层模型

第一层模型
第二层模型
混合模型
说明
截距项
 组间(时间不变)
 组内(时变的)
 交互

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), MixedEffects 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|Sub
ject,correlation=corAR1(form=~1|Subject))
 summary(fit)
 intervals(fit)#区间估计
 getVarCov(fit)#得到G矩阵

去掉Sex主效应
fit1<lme(distance~age/Sex,dd,random=~1+age|Subj
ect,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 (经验最佳线型无偏估计)
一些方差结论