6

I have around 100 models, from MCMCglmm, that give output similar to this:

> MC1 <- MCMCglmm(...)
> summary(MC1)

 Iterations = 20001:99991
 Thinning interval  = 10
 Sample size  = 8000 

 DIC: 10924.52 

 G-structure:  ~school

         post.mean l-95% CI u-95% CI eff.samp
school    0.1753   0.1059   0.2554     1529

 R-structure:  ~units

  post.mean l-95% CI u-95% CI eff.samp
units         1        1        1        0

 Location effects: bl ~ +bm1 + bm2 + bm3 + bm4 + bm5 + bm6 + bm7 + bm8

                   post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
(Intercept)        -7.381791 -8.105984 -6.657302     1212 <1e-04 ***
bm1                 0.062922  0.063024  0.078611     1028 <1e-04 ***
bm2                -0.015807 -0.016998 -0.019064     1732 <1e-04 ***
bm3                 0.005978  0.003845  0.000207     2124 <1e-04 ***
bm4                 0.223856  0.105453  0.342821     1999 <1e-04 ***
bm5                 0.044622 -0.394179  0.523072     1758   0.88    
bm6                 3.899881  3.672857  3.997223     2976 <1e-04 ***
bm7                 0.547813  0.341128  0.749568     2916 <1e-04 ***
bm8                 0.658511  0.541424  0.783192     2196 <1e-04 ***
---

Now I need to get the table of fixed effects for intercept and bm1-bm8 into a data frame (except for the pvalues - I'm not interested in those). Could anyone help me to do that so that it can be easily replicated with many more models of the same type ?

4

1 に答える 1

9

By inspecting str(summary(MC1)) we see that this information is contained in summary(MC1)$solutions with the p-values being in the fifth column. Thus, you may use

summary(MC1)$solutions[,-5]
于 2012-07-03T17:24:49.340 に答える