Specifying priors in MCMCglmm
<p>I've working on this for hours and just can't figure things out on my own. Would really appreciate any help. </p>

<p>For my dependent variable (<code>Outcome</code>), I collected 4 responses from each Subject over 4 trials. Each trial was coded either <code>POSITIVE</code>, <code>NEGATIVE</code>, or <code>AMBIVALENT</code>. The independent variables: <code>Condition</code>, <code>Gender</code>, and <code>Age.Range</code> all have 2 levels each.</p>

<p>This is a subset of my data: </p>

<pre><code>Subject Trial   Outcome Age.Range Gender Condition
PHIL060     1      AMBI         Y      2         1
PHIL060     2  NEGATIVE         Y      2         1
PHIL060     3      AMBI         Y      2         1
PHIL060     4      AMBI         Y      2         1
PHIL056     1  POSITIVE         Y      1         2
PHIL056     2      &lt;NA&gt;         Y      1         2
PHIL056     3  POSITIVE         Y      1         2
PHIL056     4  POSITIVE         Y      1         2
PHIL057     1  NEGATIVE         Y      1         1
PHIL057     2  NEGATIVE         Y      1         1
PHIL057     3  NEGATIVE         Y      1         1
PHIL057     4  NEGATIVE         Y      1         1
PHIL028     1  POSITIVE         Y      1         2
PHIL028     2  NEGATIVE         Y      1         2
PHIL028     3  NEGATIVE         Y      1         2
PHIL028     4  NEGATIVE         Y      1         2
PHIL007     1  POSITIVE         Y      1         2
PHIL007     2  NEGATIVE         Y      1         2
PHIL007     3  NEGATIVE         Y      1         2
PHIL007     4  NEGATIVE         Y      1         2
PHIL109     1      AMBI         Y      2         1
PHIL109     2      AMBI         Y      2         1
PHIL109     3      AMBI         O      2         1
PHIL109     4      AMBI         O      2         1
PHIL031     1  NEGATIVE         O      2         2
PHIL031     2  NEGATIVE         O      2         2 
PHIL031     3  NEGATIVE         O      2         2
PHIL031     4  NEGATIVE         O      2         2
PHIL032     1  NEGATIVE         O      2         2
PHIL032     2  NEGATIVE         O      2         2
PHIL032     3  NEGATIVE         O      2         2
PHIL032     4  POSITIVE         O      2         2
PHIL042     1  NEGATIVE         1      1         2
PHIL042     2  NEGATIVE         1      1         2
PHIL042     3  NEGATIVE         1      1         2
PHIL042     4  NEGATIVE         1      1         2
PHIL100     1  NEGATIVE         1      1         1
PHIL100     2  NEGATIVE         1      1         1
PHIL100     3  NEGATIVE         1      1         1
PHIL100     4  NEGATIVE         1      1         1
PHIL017     1  POSITIVE         1      1         1
PHIL017     2  POSITIVE         1      1         1
PHIL017     3  POSITIVE         1      1         1
PHIL017     4  NEGATIVE         1      1         1
PHIL018     1  NEGATIVE         1      1         1
PHIL018     2  NEGATIVE         1      1         1
PHIL018     3      AMBI         1      1         1
PHIL018     4  NEGATIVE         1      1         1
PHIL020     1  NEGATIVE         1      2         2
PHIL020     2  NEGATIVE         1      2         2
PHIL020     3  NEGATIVE         1      2         2
PHIL020     4  NEGATIVE         1      2         2
PHIL043     1  NEGATIVE         1      1         2
PHIL043     2  NEGATIVE         1      1         2
PHIL043     3  NEGATIVE         1      1         2
PHIL043     4  NEGATIVE         1      1         2
PHIL078     1  NEGATIVE         1      1         2
PHIL078     2  POSITIVE         1      1         2
PHIL078     3  POSITIVE         1      1         2
PHIL078     4  POSITIVE         1      1         2
</code></pre>

<p>I'm trying the <code>MCMCglmm</code> function:</p>

<pre><code>AP.PHIL &lt;- read.csv ("AP_PHIL.csv")
library(MCMCglmm)
k &lt;- length(levels(my.data$Outcome))
I &lt;- diag(k-1)
J &lt;- matrix(rep(1, (k-1)^2), c(k-1, k-1))

m &lt;- MCMCglmm(Outcome ~ Condition*Age.Range + Condition*Gender, 
random = ~ Subject,
rcov = ~ us(trait):units,
prior = list(
R = list(fix=1, V=0.5 * (I + J), n = 3),
G = list(G1 = list(V = diag(3), n = 3))),
      burnin = 15000,
      nitt = 40000,
      family = "categorical",
      data = my.data)
</code></pre>

<p>I keep getting this error message:</p>

<blockquote>
  <p>Error in priorformat(if (NOpriorG) { : 
      V is the wrong dimension for some prior$G/prior$R elements</p>
</blockquote>

<p>Can someone please advise me on how best to edit my priors?</p>