Learn R Programming

ergMargins (version 1.6)

edge.prob2: Function to compute tie probabilities for each dyad.

Description

Computes tie probabilities for each dyad. Largely a wrapper for edgeprob() in btergm.

Usage

edge.prob2(model,verbose=FALSE)

Value

Returns a dataframe where weach row is a dyad and each column is a term in the model, an identification variable for the vertices/dyads, or the estimated probability of observing a tie. See edgeprob() in btergm for more details.

Arguments

model

model is the ergm object.

verbose

Boolean operator. If set to T, updates user on progress of edge.prob2. May be useful for large networks.

Author

Scott Duxbury, Associate Professor, University of North Carolina--Chapel Hill, Department of Sociology. original author is Philip Leifeld at University of Essex.

Details

Computes tie probabilities for each dyad in the ERGM sample space.This function is largely a wrapper for the edgeprob function in btergm, but can be applied to curved ERGMs.

See Also

edgeprob

Examples

Run this code
# \dontshow{
require(ergm)


set.seed(21093)
a1<-network::as.network(matrix(c(rbinom(10, 1,.3),
            rbinom(10, 1,.3),
             rbinom(10, 1,.3),
              rbinom(10, 1,.3),
               rbinom(10, 1,.3),
            rbinom(10, 1,.3),
            rbinom(10, 1,.3),
            rbinom(10, 1,.3),
            rbinom(10, 1,.3),
            rbinom(10, 1,.3)),
          nrow=10,ncol=10))

network::set.vertex.attribute(a1,"var.1",rbinom(10,1,.3))

a<-ergm(a1~edges+nodeifactor("var.1")+nodeofactor("var.1"))
edge.prob2(a)

# }
# \donttest{
library(ergm)


data("faux.dixon.high")


my.ergm<-ergm(faux.dixon.high~edges+
                nodeifactor("sex")+
                nodeofactor("sex")+
                nodematch("sex")+
                mutual)
edge.prob2(my.ergm)
# }

Run the code above in your browser using DataLab