私はで働いていloglm(count~A+B+C+D+E, data=whatever)
ます。
私の問題は、すべての効果の可能な組み合わせをすべて計算したいということです。つまり、A と A+A:B と A+C+C:B+A:B:C:D:E というように (一見) 無限大になります。
助言がありますか?
編集データは次のようになります
df <- structure(list(count = c(0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
1L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L),
A = c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L), B = c(1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L), C = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L),
D = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L,
1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L), E = c(1L, 1L, 2L, 2L, 1L,
1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
2L, 1L, 1L, 2L, 2L, 1L)), .Names = c("count", "A", "B", "C", "D", "E"),
class = "data.frame", row.names = c(NA, -29L))
私が得る問題は次のとおりです。
> data(SampleData)
Warning message:
In data(SampleData) : data set ‘SampleData’ not found
> fm1 <- loglm(count ~ ., data = SampleData)
> dd <- dredge(fm1)
Error in rownames(ct)[match(names(coef1), rownames(ct))] <- fxdCoefNames :
NAs are not allowed in subscripted assignments
In addition: Warning messages:
1: In table(fac) : attempt to set an attribute on NULL (model 1 skipped)
2: In data[do.call("cbind", lapply(fac, as.numeric))] <- rsp :
number of items to replace is not a multiple of replacement length
3: In st[do.call("cbind", lapply(fac, as.numeric))] <- exp(offset) :
number of items to replace is not a multiple of replacement length
4: In double(nmar) : vector size cannot be NA/NaN (model 2 skipped)
5: In data[do.call("cbind", lapply(fac, as.numeric))] <- rsp :
number of items to replace is not a multiple of replacement length
6: In st[do.call("cbind", lapply(fac, as.numeric))] <- exp(offset) :
number of items to replace is not a multiple of replacement length
7: In double(nmar) : vector size cannot be NA/NaN (model 3 skipped)
> subset(dd, delta < 4)
Error in subset(dd, delta < 4) : object 'dd' not found