title: R-INLA: Random effect logistic regression
body: <p>I am trying to fit a random effect mix model using INLA, having previously attempted to fit using "glmer" under the frequentist approach. This failed to converge due to large number of random effects in my data. </p>
  
  <p>The data comes from a case-control type study (1 = case, 0 = control), and a list of risk factors (x1, x2, x3 ...) were calculated for each samples. All variables were categorised into groups, and the data looks as follows: </p>
  
  <pre><code>res    age            breed   x1  x2  location
  0      1 (0-1 yrs)    beef     1    1     A1
  0      2 (1-2 yrs)    dairy    1    2     A1
  1      1              beef     1    2     B2
  0      1              beef     2    1     C1
  1      3 (&gt;3 yrs)     dairy     3    3     B1
  1      2              beef      1    1     A1
  0      3              beef      2    1     B4
  ...     ...                ...          ..    ..  
  </code></pre>
  
  <p>There are around 20,000 data points with 9000 distinct locations. The INLA procedure I used is:</p>
  
  <pre><code>formula &lt;- res ~ age + breed + x1 + x2 + x3 + f(location, model = "iid")
  model &lt;- inla(formula, data = data, family = "binomial", Ntrials = 1, control.compute = list(dic = TRUE, cpo = TRUE))
  </code></pre>
  
  <p>Results from standard logistic regression (excluding random effect) offers similar parameter estimates between "glm" and INLA, however when random effect is included in the model structure as above, parameter estimates (in the logit scale) increased by more than 2 times. This means that when interpreting the odds ratio, it increases exponentially (i.e. exp(parameter estimate)), which does not seems to make sense having an odds ratio of 40...</p>
  
  <p>My question: is the INLA model specification ("iid") appropriate for this type of analysis? and if so, how do I interpret the results in terms of odds ratios between different risk groups? (using "rw2" seems to give reasonable estimates but I cannot interpret the random effect estimate under this approach)</p>
  
  <pre><code>Fixed effects:
                       mean     sd 0.025quant 0.5quant 0.975quant     mode kld
  (Intercept)      -10.8871 0.4949   -11.8440 -10.8927    -9.9506 -10.9516   0
  age_2               3.8959 0.3272     3.2739   3.8889     4.5581   3.8746   0
  age_3               4.1865 0.3421     3.5346   4.1797     4.8772   4.1659   0
  breedDairy         1.2053 0.1365     0.9393   1.2046     1.4746   1.2032   0
  x1_2                 4.8721 0.4258     4.0498   4.8682     5.7156   4.8600   0
  x1_3                 4.1444 0.3322     3.5055   4.1408     4.8039   4.1337   0
  x2_2                -1.0174 0.2727    -1.5485  -1.0189    -0.4782  -1.0220   0
  x2_3                 1.9669 0.4119     1.1570   1.9672     2.7744   1.9677   0
  
  Random effects:
  Name      Model
   location   IID model 
  
  Model hyperparameters:
                                       mean     sd 0.025quant 0.5quant 0.975quant   mode
  Precision for location 0.0621 0.0051     0.0536   0.0615     0.0734 0.0602
  
  Expected number of effective parameters(std dev): 4174.80(49.56)
  Number of equivalent replicates : 4.458 
  
  Deviance Information Criterion: 7865.86
  Effective number of parameters: 2875.54
  
  Marginal Likelihood:  -5074.21 
  CPO and PIT are computed
  </code></pre>
  
  <p>Many thanks for your help! </p>
  
  <p>Best</p>
  
  <p>s</p>