Repository navigation
nwrem 1.6.0
Added
- Diagnostics with graphs after
nwrem:estat rank,estat actors,estat time(extensions of nwrem; R's relevent has no such methods; helpnwrem_estat).estat rank: the rank of the observed sender-receiver pair among all dyads of the risk set by the fitted linear predictor, for every event (mid-ranks for ties); table with mean and median rank, mean percentile rank, the share of top-k hits (observed, expected under the model, and for a model without effects) and the mean log probability of the observed dyad; cumulative curve (default) or histogram of the percentile ranks.estat actors: observed versus expected number of events as sender and as receiver per actor (scatter with the 45 degree line, correlation and Pearson residual sums).estat time: observed versus expected over bins of consecutive events (waiting-time likelihood: events versus integrated rate; ordinal likelihood: top-k hits versus their expected number). Works with both likelihoods,condition(),riskset(),entry()/exit()and the fixed effects. - The three subcommands draw by default;
noplotshows the table only. Graph options follow the plot convention of the family:name()(default namesrank,actors,time; an existing graph is replaced, a trailing, replaceis accepted),saving()(.gph),export()(graph exportof this graph, replaced, options as ingraph export), every other option goes totwoway(histogram,graph combine) and comes last, so it overrides the defaults. Default titles, subtitles and axis titles are black,title("")removes the title, the footnote ofestat actorsis one short line (it fits a graph 3.6 inches wide),estat actorsdraws one panel withrole(sender)orrole(receiver)and hasnoequal(equal axes and a square panel by default).name(),saving(),export()and graph options withnoplotare errors (r(198)); a missing directory is r(603). - The graph code uses the shared helper
_nw_gfinishof the core; the package now requires nwcommands (core) 3.29.0 or later (nwrem.pkg,README.md). With an older core a graph stops with r(199) and a message before anything is computed; the tables need no helper. - The evaluation runs in the native plugin (new code 40; the Mata part is
RemDiag()). The protocol number stays 2 on purpose: an older package keeps working with the new plugin, and the diagnostics ask the plugin whether it knows code 40 (code 98); an older plugin stops with r(3495) and a message. Linux and Windows plugins must be rebuilt fromnative/rem_sim.cbefore these subcommands work there. e(cmdline)ande(estat_cmd):estatsets the model up again from the stored command line, so the network and the covariate variables must be in memory as at the fit.- Tests
cscripts/test_nwrem_plots.do(default names, name/saving/export, pass-through last, black titles,title(""),noplot, error paths, data untouched, old core -> r(199)) andcscripts/test_nwrem_estat_oldplugin.do(a plugin built without code 40: the fit works, estat stops with r(3495)). - Test
cscripts/test_nwrem_estat.do: all quantities against an independent enumeration in Mata (every dyad, statistics recomputed from the history) for both likelihoods, with and withoutcondition()andriskset(); graphs exported; error paths.
Tested on macOS with Stata 17 BE (the plot test, the estat test and the old-plugin test, against core 3.29.0 and the plugin of the repository). Linux (Ubuntu 22.04) and Windows 11 with StataNow 19.5 MP: the plot test and the estat test pass with the plugins built by the CI workflow for this version (commit 6a36d3f). Stata 18 on the Mac was not run for this version.