Skip to content
Prev 17204 / 20628 Next

diverging results with and without random effects

Dear Thierry and all,

Thanks for your continued help here.  I am not versed with Bayesian
analyses.

Below is the code I currently use.  The priors are basically due to
trial and error until I got expected/reasonable results.

Therefor I would be grateful for some comments on the
(in-)appropriateness of my (quite extreme) parameters.

As cov.prior I used
  invwishart(df = 50, scale = diag(0.5, 1))

Thanks in advance!

Regards,
Andreas


PS: The code/results


library("blme")
dat %>%
  bglmer(group ~ riskfactor + fu + riskfactor:fu + (1|patient),
         family = "binomial",
         data = .,
         cov.prior = invwishart(df = 50, scale = diag(0.5, 1)),
         fixef.prior = normal(cov = diag(9,4))) %>%
  summary
## ,----
## | Cov prior  : patient ~ invwishart(df = 50, scale = 0.5,
## |                  posterior.scale = cov, common.scale = TRUE)
## | Fixef prior: normal(sd = c(3, 3, ...), corr = c(0 ...),
## |                  common.scale = FALSE)
## | Prior dev  : 6.2087
## |
## | Generalized linear mixed model fit by maximum likelihood (Laplace
## |   Approximation) [bglmerMod]
## |  Family: binomial  ( logit )
## | Formula: group ~ riskfactor + fu + riskfactor:fu + (1 | patient)
## |    Data: .
## |
## |      AIC      BIC   logLik deviance df.resid
## |    540.0    560.8   -265.0    530.0      470
## |
## | Scaled residuals:
## |     Min      1Q  Median      3Q     Max
## | -2.4984 -0.8512  0.3979  0.5038  1.6228
## |
## | Random effects:
## |  Groups  Name        Variance Std.Dev.
## |  patient (Intercept) 0.009725 0.09862
## | Number of obs: 475, groups:  patient, 265
## |
## | Fixed effects:
## |                       Estimate Std. Error z value Pr(>|z|)
## | (Intercept)             1.3679     0.2355   5.810 6.26e-09 ***
## | riskfactornorisk       -1.6776     0.2868  -5.850 4.91e-09 ***
## | fuFU                    0.4718     0.3738   1.262   0.2069
## | riskfactornorisk:fuFU  -1.1375     0.4539  -2.506   0.0122 *
## | ---
## | Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
## |
## | Correlation of Fixed Effects:
## |             (Intr) rskfct fuFU
## | rskfctrnrsk -0.816
## | fuFU        -0.617  0.502
## | rskfctrn:FU  0.503 -0.618 -0.817
## `----
On 26/11/18 17:05, Thierry Onkelinx wrote: