| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/ergm.R |
| 3 |
\name{tidy.ergm} |
| 4 |
\alias{tidy.ergm} |
| 5 |
\alias{ergm_tidiers} |
| 6 |
\title{Tidy a(n) ergm object} |
| 7 |
\usage{ |
| 8 |
\method{tidy}{ergm}(x, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE, ...) |
| 9 |
} |
| 10 |
\arguments{ |
| 11 |
\item{x}{An \code{ergm} object returned from a call to \code{\link[ergm:ergm]{ergm::ergm()}}.} |
| 12 |
|
| 13 |
\item{conf.int}{Logical indicating whether or not to include a confidence |
| 14 |
interval in the tidied output. Defaults to \code{FALSE}.} |
| 15 |
|
| 16 |
\item{conf.level}{The confidence level to use for the confidence interval |
| 17 |
if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. |
| 18 |
Defaults to 0.95, which corresponds to a 95 percent confidence interval.} |
| 19 |
|
| 20 |
\item{exponentiate}{Logical indicating whether or not to exponentiate the |
| 21 |
the coefficient estimates. This is typical for logistic and multinomial |
| 22 |
regressions, but a bad idea if there is no log or logit link. Defaults |
| 23 |
to \code{FALSE}.} |
| 24 |
|
| 25 |
\item{...}{Additional arguments to pass to \code{\link[ergm:summary.formula]{ergm::summary()}}. |
| 26 |
\strong{Cautionary note}: Misspecified arguments may be silently ignored.} |
| 27 |
} |
| 28 |
\value{ |
| 29 |
A \link[tibble:tibble]{tibble::tibble} with one row for each coefficient in the |
| 30 |
exponential random graph model, with columns: |
| 31 |
\item{term}{The term in the model being estimated and tested} |
| 32 |
\item{estimate}{The estimated coefficient} |
| 33 |
\item{std.error}{The standard error} |
| 34 |
\item{mcmc.error}{The MCMC error} |
| 35 |
\item{p.value}{The two-sided p-value} |
| 36 |
} |
| 37 |
\description{ |
| 38 |
Tidy summarizes information about the components of a model. |
| 39 |
A model component might be a single term in a regression, a single |
| 40 |
hypothesis, a cluster, or a class. Exactly what tidy considers to be a |
| 41 |
model component varies across models but is usually self-evident. |
| 42 |
If a model has several distinct types of components, you will need to |
| 43 |
specify which components to return. |
| 44 |
|
| 45 |
The methods should work with any model that conforms to |
| 46 |
the \pkg{ergm} class, such as those produced from weighted networks by the |
| 47 |
\pkg{ergm.count} package. |
| 48 |
} |
| 49 |
\examples{ |
| 50 |
\dontshow{if (rlang::is_installed("ergm")) withAutoprint(\{ # examplesIf} |
| 51 |
|
| 52 |
# load libraries for models and data |
| 53 |
library(ergm) |
| 54 |
|
| 55 |
# load the Florentine marriage network data |
| 56 |
data(florentine) |
| 57 |
|
| 58 |
# fit a model where the propensity to form ties between |
| 59 |
# families depends on the absolute difference in wealth |
| 60 |
gest <- ergm(flomarriage ~ edges + absdiff("wealth")) |
| 61 |
|
| 62 |
# show terms, coefficient estimates and errors |
| 63 |
tidy(gest) |
| 64 |
|
| 65 |
# show coefficients as odds ratios with a 99\% CI |
| 66 |
tidy(gest, exponentiate = TRUE, conf.int = TRUE, conf.level = 0.99) |
| 67 |
|
| 68 |
# take a look at likelihood measures and other |
| 69 |
# control parameters used during MCMC estimation |
| 70 |
glance(gest) |
| 71 |
glance(gest, deviance = TRUE) |
| 72 |
glance(gest, mcmc = TRUE) |
| 73 |
\dontshow{\}) # examplesIf} |
| 74 |
} |
| 75 |
\references{ |
| 76 |
Hunter DR, Handcock MS, Butts CT, Goodreau SM, Morris M (2008b). |
| 77 |
\pkg{ergm}: A Package to Fit, Simulate and Diagnose Exponential-Family |
| 78 |
Models for Networks. \emph{Journal of Statistical Software}, 24(3). |
| 79 |
\url{https://www.jstatsoft.org/v24/i03/}. |
| 80 |
} |
| 81 |
\seealso{ |
| 82 |
\code{\link[=tidy]{tidy()}}, \code{\link[ergm:ergm]{ergm::ergm()}}, \code{\link[ergm:control.ergm]{ergm::control.ergm()}}, |
| 83 |
\code{\link[ergm:summary.formula]{ergm::summary()}} |
| 84 |
|
| 85 |
Other ergm tidiers: |
| 86 |
\code{\link{glance.ergm}()} |
| 87 |
} |
| 88 |
\concept{ergm tidiers} |