[R-sig-ME] Covariance values for Random Effects in MCMCGlmm?

Srivats Chari @r|v@t@ch@r| @end|ng |rom gm@||@com
Mon Nov 9 16:44:03 CET 2020


Greetings,

I have my MCMCglmm output and I was successful in extracting the random
effect using the broom.mixed package.

```
library(broom.mixed)
sample1<- tidy(mcmc_6h_v1_1run[[1]], effects = "ran_vals",conf.int = TRUE)
> head(sample1)
# A tibble: 6 x 8
  effect   group level term       estimate std.error conf.low conf.high
  <chr>    <chr> <chr> <chr>         <dbl>     <dbl>    <dbl>     <dbl>
1 ran_vals ID    10    traitspeed  -0.283      0.235   -1.09      0.570
2 ran_vals ID    1005  traitspeed  -0.0876     0.217   -0.742     0.565
3 ran_vals ID    13    traitspeed  -0.231      0.246   -1.10      0.553
4 ran_vals ID    132   traitspeed  -0.418      0.274   -1.36      0.361
5 ran_vals ID    142   traitspeed  -0.221      0.226   -0.977     0.560
6 ran_vals ID    144   traitspeed  -0.250      0.218   -0.964     0.678

```

Further I was also able to extract the covariance of the traits
```
sample2<- tidy(mcmc_6h_v1_1run[[1]], effects = "ran_pars", conf.int = T,
conf.method = "HPDinterval")

> head(sample2)
# A tibble: 6 x 8
  effect   group level term                                  estimate
std.error conf.low conf.high
  <chr>    <chr> <chr> <chr>                                    <dbl>
 <dbl>    <dbl>     <dbl>
1 ran_pars ID    NA    var__traitspeed                         0.110
 0.0256   0.0629    0.160
2 ran_pars ID    NA    cov__traitmean_act.traitspeed           0.0385
0.0326  -0.0219    0.104
3 ran_pars ID    NA    cov__traithr50.traitspeed               0.0359
0.0235  -0.0131    0.0793
4 ran_pars ID    NA    cov__traitani_excursion.traitspeed      0.0125
0.0255  -0.0378    0.0627
5 ran_pars ID    NA    cov__traithr_ratio.traitspeed          -0.0161
0.0181  -0.0488    0.0200
6 ran_pars ID    NA    cov__traitpopen_diurnality.traitspeed  -0.0769
0.0241  -0.125    -0.0331

```

Now what I am trying is to get is the covariance of traits for the random
effect. What I mean is I have 196 individuals and I am trying to get 1
value with 95% credible interval for each individual for a trait covariance
like - cov__traithr_ratio.traitspeed

Is it possible to do this with ```broom.mixed``` ? Or is there any other
way of doing this?

Any help is much appreciated. :)

Thank you in advance.!

Regards,
Srivats.

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list