Last chance! 50% off unlimited learning
Sale ends in
makeSeriesData(crimedata, offenderTable, time = c("midpoint", "earliest", "latest"))
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
must have columns named:
offenderID
and crimeID
.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
).
CS
) for every
offender. Because of co-offending, a single crime (crimeID
) can
belong to multiple crime series.
getCrimeSeries
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
Run the code above in your browser using DataLab