我正在疏通一个没有标记的入住模式,并且遇到了一些障碍:
1)首先疏通模型的检测组件后,我尝试使用先前为检测组件选择的固定预测变量子集来疏通模型的占用组件:
global_occ <-occu( ~ Freq + I(Freq^2) + n +mean_tree_d9 + mean_tree_kurt ~ C1 + C2 + C3 + C4 + S1 + S2 + S3 + S4 + Hour + I(Hour^2) + Deg_class + Freq_fire + age + Freq + mean_tree_d9 + mean_tree_d4 + mean_tree_d2 + mean_shrub_stdev + mean_tree_kurt + mean_tree_mad, umf_all)
system.time(dredge_occ<-pdredge(global_occ, rank=AIC, m.max=5, cluster=clust, fixed=`p(Freq)`&`p(I(Freq^2))`&`p(n)`&`p(mean_tree_d9)`&`p(mean_tree_kurt)`))
> dredge_occ
Global model call: occu(formula = ~Freq + I(Freq^2) + n + mean_tree_d9 + mean_tree_kurt ~
C1 + C2 + C3 + C4 + S1 + S2 + S3 + S4 + Hour + I(Hour^2) +
Deg_class + Freq_fire + age + Freq + mean_tree_d9 + mean_tree_d4 +
mean_tree_d2 + mean_shrub_stdev + mean_tree_kurt + mean_tree_mad, data = umf_all)
---
Model selection table
p(Int) psi(Int) p(Frq) p(I(Frq^2)) p(men_tre_d9) p(men_tre_krt) p(n) df logLik AIC delta weight
31 -8.68 -1.93 -8.518 -2.439 -0.2369 -0.2295 0.07039 7 -9664.791 19343.6 0 1
Models ranked by AIC(x)
更新:我尝试使用下面的Kamil解决方案,但是它不起作用,因为“ m.max”参数对任何单个模型的最大变量数(在p和psi分量上)施加了通用约束,因此不允许拟合任何psi协变量...
答案 0 :(得分:1)
?dredge
说:fixed
是“单面formula
或给出术语名称的字符向量”。在您的情况下,它是一个表达式(适合作为subset
参数)。因此,您的代码应显示为:
pdredge(global_occ, rank=AIC, m.max=5, cluster=clust, fixed=c("p(Freq)", "p(I(Freq^2))", "p(n)", "p(mean_tree_d9)", "p(mean_tree_kurt)"))