1ヶ月あいてしまうと、データセットをRに読み込むところから躓いてしまい、解析にかかるまで時間がかかってしまいましたが、なんとか解析をすることができました。
次回は、この出力を、どのように読んで、論文等の表にするときにはどのように記述するのかをやってみたいと思います。
日 時:2011年9月2日(金)16:00~18:00
テーマ:Mixed Model (18)
場 所:医学部3号館 3階S308
前回演習で行った出力(次回に使う出力)を松長さんが送って下さいました。松長さんありがとうございます!
> a <- read.csv(file.choose(), header = T)
> attach(a)
> a$centses <- ses - meanses
> library(lme4)
要求されたパッケージ Matrix をロード中です
要求されたパッケージ lattice をロード中です
次のパッケージを付け加えます: 'Matrix'
The following object(s) are masked from 'package:base':
det
次のパッケージを付け加えます: 'lme4'
The following object(s) are masked from 'package:stats':
AIC
> results1 <- lmer(mathach ~ 1 + (1 | schid), data = a)
> summary(results1)
Linear mixed model fit by REML
Formula: mathach ~ 1 + (1 | schid)
Data: a
AIC | BIC | logLik | deviance | REMLdev |
47123 | 47143 | -23558 | 47116 | 47117 |
Random effects:
Groups | Name | Variance | Std.Dev. |
schid | (Intercept) | 8.614 | 2.9350 |
Residual | 39.148 | 6.2569 |
Fixed effects:
Estimate | Std. Error | t value | |
(Intercept) | 12.6370 | 0.2443 | 51.72 |
> results2 <- lmer(mathach ~ 1 + meanses + schtype + (1 | schid), data = a)
> summary(results2)
Linear mixed model fit by REML
Formula: mathach ~ 1 + meanses + schtype + (1 | schid)
Data: a
AIC | BIC | logLik | deviance | REMLdev |
46956 | 46991 | -23473 | 46944 | 46946 |
Random effects:
Groups | Name | Variance | Std.Dev. |
schid | (Intercept) | 2.3139 | 1.5211 |
Residual | 39.1614 | 6.2579 |
Fixed effects:
Estimate | Std. Error | t value | |
(Intercept) | 12.0963 | 0.1986 | 60.90 |
meanses | 5.3329 | 0.3686 | 14.47 |
schtype | 1.2253 | 0.3058 | 4.01 |
Correlation of Fixed Effects:
(Intr) | meanss | |
meanses | 0.245 | |
schtype | -0.698 | -0.356 |
> results3 <- lmer(mathach ~ meanses + schtype + centses + meanses*centses + schtype*centses + (1 + centses|schid), data = a)
> summary(results3)
Linear mixed model fit by REML
Formula: mathach ~ meanses + schtype + centses + meanses * centses + schtype * centses + (1 + centses | schid)
Data: a
AIC | BIC | logLik | deviance | REMLdev |
46524 | 46592 | -23252 | 46496 | 46504 |
Random effects:
Groups | Name | Variance | Std.Dev. | Corr |
schid | (Intercept) | 2.38186 | 1.54333 | |
centses | 0.10138 | 0.31841 | 0.392 | |
Residual | 36.72113 | 6.05980 |
Fixed effects:
Estimate | Std. Error | t value | |
(Intercept) | 12.1136 | 0.1988 | 60.93 |
meanses | 5.3391 | 0.3693 | 14.46 |
schtype | 1.2167 | 0.3064 | 3.97 |
centses | 2.9388 | 0.1551 | 18.95 |
meanses:centses | 1.0389 | 0.2989 | 3.48 |
schtype:centses | -1.6426 | 0.2398 | -6.85 |
Correlation of Fixed Effects:
(Intr) | meanss | schtyp | centss | mnss:c | |
meanses | 0.245 | ||||
schtype | -0.697 | -0.356 | |||
centses | 0.080 | 0.020 | -0.056 | ||
menss:cntss | 0.019 | 0.079 | -0.028 | 0.282 | |
schtyp:cnts | -0.055 | -0.029 | 0.082 | -0.694 | -0.351 |
0 件のコメント:
コメントを投稿