summary.hosp_network: Create a Summary of a 'hosp_network' Object

View source: R/summary.hosp_network.R

summary.hosp_networkR Documentation

Create a Summary of a hosp_network Object


Summarize a hosp_network object by finding various statistics (hub score, authority score, Eigen centrality, etc.) for the network.


## S3 method for class 'hosp_network'
summary(object, by = c("unit", "room"), ...)



An object of class hosp_network


Two options, either 'unit' or 'room', telling whether to summarize the network by unit or room interconnectivity


Additional arguments to be passed to hub_score and authority_score, such as scale. The one already set is listed in the details section.


weights is the hub_score and authority_score option already given in this function, so to do more customization, please choose other options.


A list containing the edges, nodes, largest cliques, hub score, authority score, edge density, mean distance, betweenness, reciprocity, degree, Eigen centrality, and assortativity degree of the network given in the object. Check out the following help pages to learn more about the functions used to calculate statistics:

  • Largest Cliques - largest_cliques

  • Hub Score - hub_score

  • Authority Score - authority_score

  • Edge Density - edge_density

  • Mean Distance - mean_distance

  • Betweenness - betweenness

  • Reciprocity - reciprocity

  • Degree - degree

  • Eigen Centrality - eigen_centrality

  • Assortativity Degree - assortativity_degree


Special thanks to Josh Sadowski for providing ideas of statistics to use for this function.


hn_data <- hosp_network_data # read in example data provided in package

cleaned_hn_data <- clean_hosp_network(data = hn_data, uniqueID = UniqueEncountID, startDate = BeginDate, endDate = EndDate, unitName = UnitName, roomNum = RoomNumber) # clean the data using specific columns in the dataset

hn_object <- hosp_network(x = cleaned_hn_data, fromUnit = UnitName, toUnit = next_unit, fromRoom = RoomNumber, toRoom = next_room) # create an object of class hosp_network

summary(hn_object) # create summary for hosp_network object's unit data

summary(hn_object, by = "room", scale = FALSE) # create summary for hosp_network object's room data but do not scale hub scores and authority scores

npeters1322/hospEpi documentation built on April 30, 2022, 6:12 p.m.