背景:利用环境指标解释同种动物在不同环境下的性状(因变量)差异。采用的方法:利用广义线性模型构建模型,通过AIC准则筛选最优模型,通过对△AICc<2的模型进行模型平均。筛选出来的最优模型中包含作用不显著的环境因子(Pr(>|t|)=0.09753 .)作用不显著的环境因子也能包含在最优模型里面吗?下面是我的模型构建代码和最优模型结果
##############################线性模型构建######################################
global.model <- lm(PC2~ LD+FZZ+GM+DLWH, data=Ant.aic) #模型构建
ant.model <- glmulti(global.model,level = 1,crit="aicc") #选用AICc进行评判模型 #glmulti()函数在所有可能的模型(由用户指定的候选集)中找出n个最佳模型(模型的置信度集)
summary(ant.model)
#summary(ant.model)$icvalue #查看模型的AICc结果
weightable(ant.model)
f <- lm(PC2 ~ 1 + LD + FZZ + GM + DLWH, data=Ant.aic) #手动将筛选的bestmodel添加到函数中。
summary(f) #查看函数结果。
结果:
Call:
lm(formula = PC2 ~ 1 + LD + FZZ + GM + DLWH, data = Ant.aic)
Residuals:
Min 1Q Median 3Q Max
-8.4534 -0.3036 0.0841 0.3745 1.6864
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.466486 0.214704 -2.173 0.03125 *
LD 0.017273 0.010365 1.667 0.09753 . #该环境因子影响不显著,可以纳入最优模型吗??????
FZZ 0.005514 0.002955 1.866 0.06381 .
GM 0.009212 0.003455 2.667 0.00844 **
DLWH -0.800702 0.297627 -2.690 0.00788 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9671 on 163 degrees of freedom
Multiple R-squared: 0.08703, Adjusted R-squared: 0.06463
F-statistic: 3.885 on 4 and 163 DF, p-value: 0.004844


雷达卡



京公网安备 11010802022788号







