Learn R Programming

EpiContactTrace (version 0.8.8)

NetworkSummary-methods: NetworkSummary

Description

NetworkSummary gives a summary of the contact tracing including the time-window, InDegree, OutDegree, IngoingContactChain and OutgoingContactChain.

Arguments

Value

  • A data.frame with the following columns: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Details

The time period used for NetworkSummary can either be specified using tEnd and days or inBegin, inEnd, outBegin and outEnd.

If using tEnd and days, the time period for ingoing and outgoing contacts ends at tEnd and starts at days prior to tEnd. The network summary will be calculated for each combination of root, tEnd and days.

An alternative way is to use inBegin, inEnd, outBegin and outEnd. The time period for ingoing contacts starts at inBegin and ends at inEndDate. For outgoing contacts the time period starts at outBegin and ends at outEnd. The vectors root inBegin, inEnd, outBegin and outEnd must have the same lengths and the network summary will be calculated for each index of them.

The movements in NetworkSummary is a data.frame with the following columns: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

References

  • Dube, C., et al., A review of network analysis terminology and its application to foot-and-mouth disease modelling and policy development. Transbound Emerg Dis 56 (2009) 73-85, doi: 10.1111/j.1865-1682.2008.01064.x
  • Noremark, M., et al., Network analysis of cattle and pig movements in Sweden: Measures relevant for disease control and riskbased surveillance. Preventive Veterinary Medicine 99 (2011) 78-90, doi: 10.1016/j.prevetmed.2010.12.009

Examples

Run this code
## Load data
data(transfers)

## Perform contact tracing using tEnd and days
contactTrace <- Trace(movements=transfers,
                      root=2645,
                      tEnd='2005-10-31',
                      days=91)

## Calculate network summary from a ContactTrace object
ns.1 <- NetworkSummary(contactTrace)

## Calculate network summary using tEnd and days
ns.2 <- NetworkSummary(transfers,
                       root=2645,
                       tEnd='2005-10-31',
                       days=91)

## Check that the result is identical
identical(ns.1, ns.2)

## Calculate network summary using inBegin, inEnd
## outBegin and outEnd
ns.3 <- NetworkSummary(transfers,
                       root=2645,
                       inBegin='2005-08-01',
                       inEnd='2005-10-31',
                       outBegin='2005-08-01',
                       outEnd='2005-10-31')

## Check that the result is identical
identical(ns.2, ns.3)

## When calculating the network summary for a data.frame of movements
## a data.frame for each combination of root, tEnd and days are returned.
root <- c(1,2,3)
tEnd <- c("2005-09-01", "2005-10-01")
days <- c(30, 45)

## The network summary are calculated at the following
## 12 combinations.
## root = 1, tEnd = "2005-09-01", days = 30
## root = 1, tEnd = "2005-09-01", days = 45
## root = 1, tEnd = "2005-10-01", days = 30
## root = 1, tEnd = "2005-10-01", days = 45
## root = 2, tEnd = "2005-09-01", days = 30
## root = 2, tEnd = "2005-09-01", days = 45
## root = 2, tEnd = "2005-10-01", days = 30
## root = 2, tEnd = "2005-10-01", days = 45
## root = 3, tEnd = "2005-09-01", days = 30
## root = 3, tEnd = "2005-09-01", days = 45
## root = 3, tEnd = "2005-10-01", days = 30
## root = 3, tEnd = "2005-10-01", days = 45
NetworkSummary(transfers, root, tEnd, days)

## Create a network summary for all included herds
## First extract all source and destination from the dataset
root <- sort(unique(c(transfers$source,
                      transfers$destination)))

## Perform contact tracing using tEnd and days
result.1 <- NetworkSummary(transfers,
                           root=root,
                           tEnd='2005-10-31',
                           days=90)

## Perform contact tracing using inBegin, inEnd, outBegin and outEnd.
result.2 <- NetworkSummary(transfers,
                           root=root,
                           inBegin=rep('2005-08-02', length(root)),
                           inEnd=rep('2005-10-31', length(root)),
                           outBegin=rep('2005-08-02', length(root)),
                           outEnd=rep('2005-10-31', length(root)))

Run the code above in your browser using DataLab