との3つの因子:ベスト構造 - 私は次のような問題に反復測定分析/縦方向のデータを実行したい1縦
「領域で分析した16本の木がありますし、 B領域では16である。各地域では、冬季に8本、夏季に8本の木が分析されたが、同じ樹木ではない。私はと各ツリー直径約5つの異なる深さでstarch's知覚的。」
tree Region season depth starch
1 A W 1 0.07
1 A W 2 0.10
1 A W 3 0.13
1 A W 4 0.16
1 A W 5 0.11
2 A W 1 0.07
2 A W 2 0.10
2 A W 3 0.13
2 A W 4 0.16
2 A W 5 0.11
... ... ... ... ...
17 B S 1 0.06
... ... ... ... ...
私が考えるにはR.でガンマ分布と一般化線形混合モデル(GLMM)でフィット感を得ることを考慮すると、 GLMMの初心者のようなものですが、リージョン、シーズン、デプスファクタがレスポンス変数に異なる影響を与えるかどうかを知るために、Rにどのように適合するかを尋ねたいと思います。
私が実行した場合には、正しい次のようになります。
require(lme4)
Mod1=glmer(starch~Region*season*depth+(1|tree),data=data,family="gamma")
summary(Mod1)
?
ない場合は、何がそれについて手続きするための最良の方法だろうか?誰かが私に方向性または少なくとも参照を与えることができれば、とても感謝しています。
@Ben Bolkerと@fliesのご協力ありがとうございます。投稿された貢献は多くの助けになりました。 次に、深度を定性的に扱うことが可能かどうかを確認し、Region * stage * depth
の対話を確認します。これを行う:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation)
glmerMod]
Family:Gamma(log)
Formula: starch ~Region*season*depth+(1|tree)
Date: data
AIC BIC logLik deviance df.resid
-1358.4 -1290.7 701.2 -1402.4 138
Scaled residuals:
Min 1Q Median 3Q Max
-2.3398 -0.6699 -0.1065 0.6683 3.2020
Random effects:
Groups Name Variance Std.Dev.
tree (Intercept) 7.171e-05 0.008468
Residual 6.020e-04 0.024536
Number of obs: 160, groups: tree, 32
Fixed effects:
Estimate Std. Error t value Pr (> | z |)
(Intercept) -2.593064 0.009621 -269.51 <2e-16 ***
RegionRP 0.260453 0.013607 19.14 <2e-16 ***
seasonV -0.193693 0.013607 -14.23 <2e-16 ***
depth2 0.409813 0.011894 34.46 <2e-16 ***
depth3 0.594269 0.011893 49.97 <2e-16 ***
depth4 0.779051 0.011893 65.50 <2e-16 ***
depth5 0.432146 0.011893 36.34 <2e-16 ***
RegionRP:seasonV 0.088320 0.019243 4.59 4.44e-06 ***
localRP:depth2 -0.065211 0.016820 -3.88 0.000106 ***
localRP:depth3 -0.130185 0.016819 -7.74 9.92e-15 ***
localRP:depth4 -0.190743 0.016820 -11.34 <2e-16 ***
localRP:depth5 -0.067266 0.016820 -4.00 6.35e-05 ***
seasonV:depth2 0.031624 0.016821 1.88 0.060103.
seasonV:depth3 0.139424 0.016820 8.29 <2e-16 ***
seasonV:depth4 0.147717 0.016820 8.78 <2e-16 ***
seasonV:depth5 0.107589 0.016820 6.40 1.59e-10 ***
RegionRP:seasonV:depth2 -0.018490 0.023787 -0.78 0.436970
RegionRP:seasonV:depth3 -0.113810 0.023786 -4.78 1.71e-06 ***
RegionRP:seasonV:depth4 -0.112337 0.023787 -4.72 2.33e-06 ***
RegionRP:seasonV:depth5 -0.121932 0.023787 -5.13 2.96e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '' 1
Analysis of Deviance Table (Type II Wald chisquare tests)
Response: starch
Chisq Df Pr (> Chisq)
Region 872.9486 1 <2.2e-16 ***
season 282.9125 1 <2.2e-16 ***
depth 16726.2395 4 <2.2e-16 ***
Region:season 1.5641 1 0.2111
Region:depth 521.4171 4 <2.2e-16 ***
season:depth 85.5213 4 <2.2e-16 ***
Region:season:depth 49.1586 4 5.41e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '' 1
は、上記の分析を行うことができた。
data = within (data, {
Region = factor (Region)
season = factor (season)
depth = factor (depth) })
require (lme4)
Mod1 = glmer (starch~Region*season*depth+(1|tree),data=data,family=Gamma(link="log"))
summary (Mod1)
library (car)
Anova(mod1)
は、次のような結果を得ますか?推定されたパラメータの数を考えると、連続深さと加法モデルを考慮する必要がありますか?
'Region'はランダム効果' tree'によって混乱しているようです。 'lme4'がこれをどのように処理するかをIDKに伝えます。いくつかのタイプミスを除いて、コードは大丈夫です( 'region'は' Region'、 'mod1_glmer'は' Mod1'でなければなりません)。 – flies
このモデルから何を学ぼうとしていますか? – flies
編集機能を使用して、(タグの下の)タイプミスを修正することができます – flies