Learn R Programming

xergm.common (version 1.7.1)

alliances: Longitudinal international defense alliance network, 1981--2000

Description

The alliances dataset contains the international defense alliance network among 164 countries, covering the years 1981--2000. In addition to the yearly defense alliance network, it contains data on military capabilities, governing regime type, geographic contiguity and international conflict. This is an excerpt from a dataset that has been used in two published analyses. The full dataset (Cranmer, Desmarais and Menninga 2012; Cranmer, Desmarais and Kirlkand 2012) contains a large number of countries and a much longer time series.

Usage

data("alliances")

Arguments

source

The data were gathered by Skyler Cranmer and Bruce Desmarais in the process of writing Cranmer, Desmarais and Menninga (2012) and Cranmer, Desmarais and Kirlkand (2012). Permission to redistribute this dataset along with this package was granted by Skyler Cranmer and Bruce Desmarais on December 15, 2015. Questions about the data should be directed to them.

References

Skyler J. Cranmer, Bruce A. Desmarais, and Justin H. Kirkland (2012): Toward a Network Theory of Alliance Formation. International Ineractions 38(3): 295--324. Skyler J. Cranmer, Bruce A. Desmarais, and Elizabeth Menninga (2012): Complex Dependencies in the Alliance Network. International Ineractions 29(3):279--313.

Examples

Run this code
library("xergm")
data("alliances")

# btergm formulas look very similar to ERGM formulas.
# Note the R argument; usually want R > 1000.
# Here it is set to 50 to limit computation time.
# First, set the seed for replicability.
set.seed(123)
model <- btergm(allyNet ~ edges + gwesp(0, fixed = TRUE) 
    + edgecov(lNet) + edgecov(LSP) + edgecov(warNet) 
    + nodecov("polity") + nodecov("cinc") + absdiff("polity") 
    + absdiff("cinc") + edgecov(contigMat) + nodecov("year"), 
    R = 50)

# View estimates and confidence intervals.
summary(model)

# Evaluate model fit. Simulate 100 networks for each time point.
# Calculate edgewise shared partners, degree and geodesic distance 
# distance distributions.
alliance_gof <- gof(model, statistics = c(deg, esp, geodesic))

# Plot goodness of fit.
plot(alliance_gof)

Run the code above in your browser using DataLab