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 ?
The model summary table reports the strength of the relationship between the model and the dependent variable. R, the multiple correlation coefficient, is the linear correlation between the observed and model-predicted values of the dependent variable.
The model summary displays the name of the model, the model type, and the model formula. For parametric models (Linear Regression and Logistic Regression), additional summary statistics, appropriate for the particular model type are also shown.
Interpreting Linear Regression CoefficientsA positive coefficient indicates that as the value of the independent variable increases, the mean of the dependent variable also tends to increase. A negative coefficient suggests that as the independent variable increases, the dependent variable tends to decrease.
The Pr(>|t|) column represents the p-value associated with the value in the t value column. If the p-value is less than a certain significance level (e.g. α = . 05) then the predictor variable is said to have a statistically significant relationship with the response variable in the model.
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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With