当我在mcmcglmm中使用hupossion时,如何使用idh和random?

时间:2016-03-09 10:30:50

标签: r random glm

这是我的问题:我需要在MCMCglmm包中使用hupossion。这是我的先前:

> prior = list(R = list(V = diag(2), nu = 0.002),
 +                G = list(G1 = list(V = diag(10), nu = 0.002),
 +                           G2 = list(V = 1, nu = 0.002)))

这是我的训练:

> myTrain <- MCMCglmm(pipenumyearnosameday ~ trait - 1 +
+                         at.level(trait,1):lastyearnumnosameday + 
+                         at.level(trait,1):pipeInsideSizemm,
+                     random = ~idh(pipematerialgroup1):installyeargroup1,
+                     data = train,
+                     prior = prior,
+                     verbose = F,
+                     pr=T,
+                     family = "hupoisson",
+                     rcov = ~idh(trait):units)

属性pipematerialroup1中有5个级别。我知道先前一定是错的。我收到了以下信息:

Error in MCMCglmm(pipenumyearnosameday ~ trait - 1 + at.level(trait, 1):lastyearnumnosameday + : prior$G has the wrong number of structures

我还需要说一件事:

myPredict <- predict(myTrain,newdata = myTest,type = "response",marginal = ~idh(trait):pipematerialgroup1,interval = "confidence") 

当我将pipematerialgroup1作为随机效应时,这是我的预测部分。如果将pipematerialgroup1和installyeargroup1结合起来,这预测会是什么?

有人可以帮助我获得优先权吗?非常感谢。

0 个答案:

没有答案