混合重复测量模型的MCMCglmm函数和R中的先验误差

时间:2018-08-07 09:43:14

标签: r statistics mixed-models mcmc

我正在尝试使用MCMCglmm建模一些数据,并在是否处于治疗条件下(BZ_ID)于4年(时间)内每年进行一次结局测量(HoNOSTotal)。

我对此很陌生,但这是我到目前为止所拥有的:

k <- length(levels(BZData$HoNOSTotal))
I <- diag(k-1)
J <- matrix(rep(1, (k-1)^2), c(k-1, k-1))

prior1 <- list(R = list(fix=1, V = 0.5*(I+J), nu = 0.002),
           G = list(G1 = list(V = diag(1), nu = 0.002)))

mcmc<- MCMCglmm(HoNOSTotal ~ -1 + BZ_ID + Time + Time:BZ_ID,
            data = BZData,
            random = ~ us(-1 +ID),
            family = "gaussian",
            prior = prior1,
            nitt = 1000,
            burnin = 200)
summary(mcmc)

但是我不断收到错误消息:

Error in priorformat(if (NOpriorG) { : 
  V is the wrong dimension for some prior$G/prior$R elements
In addition: Warning messages:
1: Unknown or uninitialised column: 'family'. 
2: Setting row names on a tibble is deprecated. 
3: Unknown or uninitialised column: 'MCMC_dummy'.

如果任何人都可以提出有关如何解决此问题的建议,将不胜感激

0 个答案:

没有答案