Description Usage Arguments Value References Examples
View source: R/clean_summary.R
This function takes a stan
object and return a clean summary of the posterior distribution.
1 | clean_summary(fergm.fit = NULL, custom_var_names = NULL)
|
fergm.fit |
A model object returned by the |
custom_var_names |
A vector of custom variable names used in presentation that match the order of the |
This function returns a matrix summarizing the posterior distribution, including variable names, posterior means, and 95
Box-Steffensmeier, Janet M., Dino P. Christenson, and Jason W. Morgan. 2018. “Modeling Unobserved Heterogeneity in Social Networks with the Frailty Exponential Random Graph Model." Political Analysis. (26)1:3-19.
Stan Development Team (2016). RStan: the R interface to Stan. R package version 2.14.1. http://mc-stan.org/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# The fergm.fit$stan.fit object is of class stanfit.
# We keep it this way such that users can rely upon
# conventional stan functions for interpretation
# getting posterior distributions from the fergm
# Conventional rstan summary call
# load example data
data("ergm.fit")
data("fergm.fit")
data("mesa")
stan.smry <- summary(fergm.fit$stan.fit)$summary
beta_df <- stan.smry[grep("beta", rownames(stan.smry)),]
est <- round(beta_df[,c(1,4,8)], 3)
# We have a built in function to do this simply
est <- clean_summary(fergm.fit)
est <- clean_summary(fergm.fit,
custom_var_names = c("Edges", "Sex Homophily", "Grade Homophily",
"Race Homophily", "GWESP", "Alternating K-Stars"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.