我正在对寄生虫和体重的普遍程度进行比较分析。这些数据来自51种鸟类,因此我必须纠正系统发育的独立性。
我进行了两次分析,一次使用简单的GLM,然后使用MCMCGLMM,包括系统发育作为随机因子。
现在我怀疑:两种模型的结果完全不同,使用GLM我得到了非常显着的相关性,但是MCMCGLMM根本没有相关性,但λ值非常低,几乎为零,这意味着结果从两个分析来看应该不会太大。 这让我觉得我可能犯了一个错误。
以下是代码和结果:
GLM
m0 <- glm(cbind(M_inf,M_not_inf)~log(M.bs), data = df, family = binomial())
摘要(M0)
Call:
glm(formula = cbind(M_inf, M_not_inf) ~ log(M.bs), family = binomial(), data = df)
Deviance Residuals:
Min 1Q Median 3Q Max
-18.025 -1.222 1.294 4.059 9.615
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.46888 0.14458 -10.160 <2e-16 ***
log(M.bs) 0.17192 0.02369 7.256 4e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1181.7 on 50 degrees of freedom
Residual deviance: 1127.6 on 49 degrees of freedom
AIC: 1315.2
Number of Fisher Scoring iterations: 4
GLMM
inv.phylo<-inverseA(Species,nodes="TIPS",scale=TRUE)
prior<-list(G=list(G1=list(V=1,nu=0.02)),R=list(V=1,nu=0.02))
m1 <- MCMCglmm(cbind(M_inf,M_not_inf)~log(M.bs),random=~Species,
family="multinomial2",
ginverse=list(Species=inv.phylo$Ainv),prior=prior,
data=df,nitt=5000000,burnin=1000,thin=500)
lambda1 <- m1$VCV[,"Species"]/(m1$VCV[,"Species"]+m1$VCV[,"units"])
mean(lambda1)
摘要(M1)
Iterations = 1001:4999501
Thinning interval = 500
Sample size = 9998
DIC: 3101.985
G-structure: ~Species
post.mean l-95% CI u-95% CI eff.samp
Species 0.1828 0.001691 0.736 9689
R-structure: ~units
post.mean l-95% CI u-95% CI eff.samp
units 2.44 1.343 3.719 9998
Location effects: cbind(M_inf, M_not_inf) ~ log(M.bs)
post.mean l-95% CI u-95% CI eff.samp pMCMC
(Intercept) 0.19983 -1.86335 2.14110 9998 0.836
log(M.bs) -0.03204 -0.35361 0.27118 9563 0.838
平均(lambda1) [1] 0.06234505
有什么想法? 非常感谢