Classroom relational-event study
This example follows the classroom analysis in Chapter 13, Part 4 of J. A. Smith’s Network Analysis: Integrating Social Network Theory, Method, and Application with R:
https://inarwhal.github.io/NetworkAnalysisR-book/ch13-Relational-Event-Models-R.html
The original R Markdown file is linked rather than copied. Provenance, source
URLs, checksums, and reuse terms for the retained data are recorded in
data/classroom_events/SOURCES.md and data/classroom_events/LICENSE.md.
Analysis reproduced here
The example uses the same classroom interaction data and follows the relevant preparation choices from the tutorial. It:
loads interaction histories for two dates;
removes broadcast interactions where
to_all_colorfrom_all_colis set;maps
time_estimate_col,send_col, andreceive_colto the event time, sender, and receiver;derives intercept, gender, and teacher actor attributes;
builds seating and friendship dyadic covariates;
fits baseline, actor-covariate, dyadic-covariate, recency, and participation- shift specifications.
What the comparison means
The tutorial fits an exact-time model with relevent::rem.dyad(). The REMFlow
example can fit exact-time and ordinal models to the same event histories and
covariate definitions. It reproduces the study design and workflow, but it does
not claim coefficient-by-coefficient equivalence with the R estimator.
Run the example
PYTHONPATH=src python examples/classroom_event_study.py
PYTHONPATH=src python examples/classroom_event_study.py --timing exact
In Windows PowerShell:
$env:PYTHONPATH='src'
python examples/classroom_event_study.py
Data files
The local copies are stored in data/classroom_events/:
class_interactions_date1.txtclass_interactions_date2.txtclass_attributes.txtclass_seating_date1.txtclass_seating_date2.txtclass_edgelist_sem2.txt
They were downloaded from the public Integrated_Network_Science repository
used by the tutorial. The files retain the upstream CC BY-NC-ND 4.0 license and
are not covered by REMFlow’s MIT license.