0

如果没有正确完成,第一次向我发布如此赤裸裸的问题。当运行季节相关的殖民和灭绝以及未标记的完全时间相关的模型时,我收到“对比”消息中的错误。我已经用以前的数据集运行了一个非常相似的脚本并且它有效,我的变量都没有少于两个因素,所以我很茫然。参见示例:

输入(站点协变量)

structure(list(site = c("c1", "c2", "c3", "c4", "c5", "c6", "c7", 
"c8", "c9", "c10"), habitat = c("forest", "forest", "intervened", 
"forest", "forest", "forest", "forest", "forest", "intervened", 
"intervened"), z_dis_area_cons = c(0.01417616, 1.293259454, -1.239008999, 
1.450977679, 0.996786633, -1.386719679, -0.345627422, 0.155103464, 
-0.369931339, 1.402797566)), row.names = c(NA, 10L), class = "data.frame")

输入(HistDet)

structure(list(s1v1 = c(0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 1L
), s1v2 = c(1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, NA, 0L), s1v3 = c(0L, 
0L, 0L, 1L, 1L, 0L, 0L, 0L, NA, 0L), s1v4 = c(0L, 0L, 0L, 1L, 
0L, 0L, 0L, 0L, 1L, 0L), s1v5 = c(0L, 0L, 0L, 1L, 1L, 0L, 0L, 
0L, 0L, 0L), s1v6 = c(0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L), 
    s2v1 = c(0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 1L), s2v2 = c(0L, 
    0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L), s2v3 = c(0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 1L, 0L), s2v4 = c(0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L), s2v5 = c(1L, 0L, 1L, NA, 0L, 0L, 0L, 
    0L, 1L, 0L), s2v6 = c(0L, 0L, 0L, NA, 0L, NA, 0L, 0L, 0L, 
    0L)), row.names = c(NA, 10L), class = "data.frame")
season<-as.character(1:2)
season<-matrix(season,nrow(HistDet),2,byrow=TRUE)
Datos <- unmarkedMultFrame(y = HistDet, siteCovs = sitecovariates, yearlySiteCovs=list(s=season), numPrimary=2)
mo0<-colext(~1,~1,~1,~1,Datos)
mo1<-colext(~1,~1,~1,~s,Datos)

#season 依赖殖民和灭绝

mo2<-colext(~1,~s-1,~s-1,~1,Datos)

#完全依赖时间

mo3<-colext(~1,~s-1,~s-1,~s,Datos)

我会很感激任何建议。

4

0 回答 0