I have a data structured as follows:
A
is the count of positive cases in a cohortB
is the total count of the cohort minusA
.C
is a binary variableD
-F
are normally distributed continuous variablesG
is 6 level factor
I am using MCMCglmm package in R to analyse this data to find which of the variables C
- G
affect A
and B
.
I have done this successfully using lme4's glmer
function with success but now I wish to add more random effects which I have been advised will be better handled by the MCMC optimised variation. However, given the following function call
MCMCmod1 <- MCMCglmm(cbind(A, B) ~ C + D + E + F,
random = G,
prior = prior,
family ="multinomial2",
data = g)
(I appreciate the family may not be correct in this case)
Where
prior = list(R = list(V = 1, n = 0, fix = 1),
G = list(
G1 = list(V = 1, n = 1),
G2 = list(V = 1, n = 1),
G3 = list(V = 1, n = 1),
G4 = list(V = 1, n = 1),
G5 = list(V = 1, n = 1)))
I get the following error
Error in `[<-.data.frame`(`*tmp*`, , response.names, value = c(0, 0, 0, :
missing values are not allowed in subscripted assignments of data frames
However, when I check my variables there are 100% no NAs.
Any ideas on the steps I can take to try to debug this?