Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
The methods should work with any model that conforms to the ergm class, such as those produced from weighted networks by the ergm.count package.
# S3 method for ergm tidy(x, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE, ...)
x | An |
---|---|
conf.int | Logical indicating whether or not to include a confidence
interval in the tidied output. Defaults to |
conf.level | The confidence level to use for the confidence interval
if |
exponentiate | Logical indicating whether or not to exponentiate the
the coefficient estimates. This is typical for logistic and multinomial
regressions, but a bad idea if there is no log or logit link. Defaults
to |
... | Additional arguments to pass to |
A tibble::tibble with one row for each coefficient in the exponential random graph model, with columns:
The term in the model being estimated and tested
The estimated coefficient
The standard error
The MCMC error
The two-sided p-value
Hunter DR, Handcock MS, Butts CT, Goodreau SM, Morris M (2008b). ergm: A Package to Fit, Simulate and Diagnose Exponential-Family Models for Networks. Journal of Statistical Software, 24(3). https://www.jstatsoft.org/v24/i03/.
tidy()
, ergm::ergm()
, ergm::control.ergm()
,
ergm::summary()
Other ergm tidiers:
glance.ergm()
if (requireNamespace("ergm", quietly = TRUE)) { library(ergm) # Using the same example as the ergm package # Load the Florentine marriage network data data(florentine) # Fit a model where the propensity to form ties between # families depends on the absolute difference in wealth gest <- ergm(flomarriage ~ edges + absdiff("wealth")) # Show terms, coefficient estimates and errors tidy(gest) # Show coefficients as odds ratios with a 99% CI tidy(gest, exponentiate = TRUE, conf.int = TRUE, conf.level = 0.99) # Take a look at likelihood measures and other # control parameters used during MCMC estimation glance(gest) glance(gest, deviance = TRUE) glance(gest, mcmc = TRUE) } #> Registered S3 methods overwritten by 'ergm': #> method from #> simulate.formula lme4 #> simulate.formula_lhs lme4 #> Loading required package: network #> #> ‘network’ 1.17.1 (2021-06-12), part of the Statnet Project #> * ‘news(package="network")’ for changes since last version #> * ‘citation("network")’ for citation information #> * ‘https://statnet.org’ for help, support, and other information #> #> ‘ergm’ 4.1.2 (2021-07-26), part of the Statnet Project #> * ‘news(package="ergm")’ for changes since last version #> * ‘citation("ergm")’ for citation information #> * ‘https://statnet.org’ for help, support, and other information #> ‘ergm’ 4 is a major update that introduces some backwards-incompatible #> changes. Please type ‘news(package="ergm")’ for a list of major #> changes. #> Starting maximum pseudolikelihood estimation (MPLE): #> Evaluating the predictor and response matrix. #> Maximizing the pseudolikelihood. #> Finished MPLE. #> Stopping at the initial estimate. #> Evaluating log-likelihood at the estimate. #> #> Though `glance` was supplied `mcmc = TRUE`, the model was not fittedusing MCMC, so the corresponding columns will be omitted. #> # A tibble: 1 × 5 #> independence iterations logLik AIC BIC #> <lgl> <int> <dbl> <dbl> <dbl> #> 1 TRUE 4 -51.0 106. 112.