微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

随机效应的协方差值-MCMCGlmm

如何解决随机效应的协方差值-MCMCGlmm

我有我的MCMCglmm输出,并且使用broom.mixed包成功提取随机效果

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

我还可以提取这些特征的协方差

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

现在我正在尝试的是获得随机效应的性状协方差。我的意思是,我有196个个体,我正在尝试为每个个体(例如-cov__traithr_ratio.traitspeed

获取1个值,每个个体的可信区间为95%

是否可以使用broom.mixed来做到这一点?还是有其他方法可以做到这一点?

我们非常感谢您的帮助。 :)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。