Manipulating resume results (models)

I have about 100 models, from MCMCglmm, that give a result 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 a table of fixed effects for interception and bm1-bm8 in the data frame (with the exception of pvalues ​​- this does not interest me). Can someone help me do this so that it can be easily reproduced with many other models of the same type?

+6
source share
1 answer

Having studied str(summary(MC1)) we see that this information is contained in summary(MC1)$solutions with p-values ​​in the fifth column. So you can use

 summary(MC1)$solutions[,-5] 
+9
source

Source: https://habr.com/ru/post/919608/


All Articles