template_network: Construct an Empty "Template" Network Consistent with an...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/egor.R

Description

Taking a egor object, constructs a network object with no edges whose vertices have the attributes of the egos in the dataset, replicating the egos as needed, and taking into accounts their sampling weights.

Usage

1
template_network(x, N, scaling = c("round", "sample"), ...)

Arguments

x

A egor object or a data.frame.

N

The target number of vertices the output network should have.

scaling

If egor contains weights or N is not a multiple of number of egos in the sample, it may not be possible, for a finite N to represent each ego exactly according to its relative weight, and scaling controls how the fractional egos are allocated:

"round"

(the default) Rather than treating N as a hard setting, calculate N w_i / w_\cdot for each ego i and round it to the nearest integer. Then, the N actually used will be the sum of these rounded freqencies.

"sample"

Resample in proportion to w_i.

...

Additional arguments, currently unused.

Value

A network object.

Author(s)

Pavel N. Krivitsky

See Also

as.egor.network, which performs the inverse operation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(faux.mesa.high)
summary(faux.mesa.high, print.adj = FALSE)

fmh.ego <- as.egor(faux.mesa.high)

# Same actor attributes
fmh.template <- template_network(fmh.ego, N=network.size(faux.mesa.high))
summary(fmh.template, print.adj = FALSE)

# Twice the actors, same distribution
fmh2.template <- template_network(fmh.ego, N=2*network.size(faux.mesa.high))
summary(fmh2.template, print.adj = FALSE)

statnet/ergm.ego documentation built on April 26, 2021, 4:46 a.m.