3 개 요소 :최저 구조 - 나는 다음과 같은 문제에 대한 반복 측정 분석/세로 데이터를 수행하고자하는 1 종
"는 영역에서 분석 하였다 (16) 나무가 있고 16). 각 지역에서 8 개의 나무가 겨울에 분석되었고 8 개의 나무가 여름에 분석되었지만 같은 나무가 아닙니다. 나는 각 나무의 직경에 대한 다섯 가지 깊이에서 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)
는 다음과 같은 결과를 얻기? 추정 된 매개 변수의 수를 감안할 때, 연속 깊이와 additive 모델을 고려해야합니까?
'Region'이 무작위 효과'tree'에 의해 혼동 된 것처럼 보입니다. IDK는'lme4'가 이것을 어떻게 처리 하는지를 설명합니다. 몇 가지 오타를 제외하고 코드는 괜찮아 보입니다 ('region'은'Region'이어야하고, mod1_glmer는'Mod1'이어야합니다). – flies
이 모델에서 무엇을 배우려고합니까? – flies
수정 기능을 사용하여 (태그 아래에있는) 오타를 바로 잡을 수 있습니다. – flies