makeSeriesData {crimelinkage}R Documentation

Make crime series data

Description

Creates a data frame with index to crimedata and offender information. It is used to generate the linkage data.

Usage

makeSeriesData(crimedata, offenderTable, time = c("midpoint", "earliest",
  "latest"))

Arguments

crimedata

data.frame of crime incident data. crimedata must have columns named: crimeID, DT.FROM, and DT.TO. Note: if crime timing is known exactly (uncensored) than only DT.FROM is required.

offenderTable

offender table that indicates the offender(s) responsible for solved crimes. offenderTable must have columns named: offenderID and crimeID.

time

the event time to be returned: 'midpoint', 'earliest', or 'latest'

Details

The creates a crimeseries data object that is required for creating linkage data. It creates a crime series ID (CS) for every offender. Because of co-offending, a single crime (crimeID) can belong to multiple crime series.

Value

data frame representation of the crime series present in the crimedata. It includes the crime ID (crimeID), index of that crimeID in the original crimedata (Index), the crime series ID (CS) corresponding to each offenderID, and the event time (TIME).

See Also

getCrimeSeries

Examples

data(crimes)
 data(offenders)

 seriesData = makeSeriesData(crimedata=crimes,offenderTable=offenders)
 head(seriesData)

 nCrimes = table(seriesData$offenderID)  # length of each crime series
 table(nCrimes)                  # distribution of crime series length
 mean(nCrimes>1)                 # proportion of offenders with multiple crimes

 nCO = table(seriesData$crimeID) # number of co-offenders per crime
 table(nCO)                      # distribution of number of co-offenders
 mean(nCO>1)                     # proportion of crimes with multiple co-offenders

[Package crimelinkage version 0.0.4 Index]