statnet / tergm

Fit, Simulate and Diagnose Models for Network Evolution Based on Exponential-Family Random Graph Models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add summary_formula methods for lists and network.lists

martinamorris opened this issue · comments

if it's not too much trouble...

There isn't one for lists, but there's one for network.lists, and it just evaluates the summary on each network in the list.

hmm. i'm not having any luck with summary(network.list ~ terms):

data(samplk)
samp.list <- list(samplk1,samplk2)
samp.netlist <- network.list(samp.list)
summary.netlist <- summary(samp.netlist ~
                            Form(~edges) +
                            Diss(~edges))
Error: In term ‘Form (dynamic)’ (called from term ‘Form’ in package ‘tergm’): This term requires either dynamic data (network series or network dynamic or last toggle information) or for dynamic mode to be set (typically by passing ‘dynamic=TRUE)’ to the top-level function.

Right. This is because that method is defined in ergm, and treats each network individually; this is probably how it should be, since we shouldn't assume that the user wants to omit and condition on the first network, unless they actually use NetSeries.

We could implement a tsummary.formula() method analogous to tergm that would do that automatically.

Can we make it an argument to summary, instead of a new function?

We'd have to do the same kind of switcheroo that we do with simulate_formula.network(), and that would probably require changing ergm, which we probably don't want to do for this release.

Longer term, we really need to figure out a better way to do this.

For this release, we may have to just tell people to use NetSeries(). I don't think we have time for anything else.

They can also use networkDynamic

I am not 100% sure if there is an easy way to go from a network list to a networkDynamic. @skyebend ?

summary_formula already works for networkDynamic

@CarterButts, oh, I missed that one. @martinamorris, sounds like we have a solution.

Is this still an issue?