Skip to content

API reference

Every function, by family. Each has its own page: signature, parameters, returns, notes, references and examples.

Veil of darkness, odds ratios and risks, the outcome test, benchmarks and dyadic rates.

Function What it computes
vodtst() Veil-of-darkness test
orrisk() Risks behind an odds ratio
outtst() Outcome test
dspbm() Benchmark decomposition of a disparity
dyadrt() Dyadic offending rates

DNA match statistics, the weight and calibration of likelihood ratios, kinship, paternity, mixtures and database searches.

Function What it computes
gtmp() Genotype match probability
lrpost() Posterior probability from a likelihood ratio
cllr() Log-likelihood-ratio cost
cllrmin() Log-likelihood-ratio cost after recalibration
lrcal() Calibrated likelihood ratios
tipplt() Tippett plot
eceplt() Empirical cross-entropy plot
mixlr() Mixture likelihood ratio
kinidx() Kinship index
patidx() Paternity index
dbsrch() Database search

Clearance rates, exposure proxies, misrecorded groups and regression to the mean.

Function What it computes
clrsmp() Clearance-rate decomposition and Simpson’s paradox
expbnd() Rates and disparities when exposure is measured by a proxy
misrd() Risk difference when group membership is misrecorded
rtmhs() Regression to the mean at selected hot spots

Incapacitation, release rules, time in custody, sentence effects and hazards after selection.

Function What it computes
incap() Incapacitation: crime rate, share prevented and the marginal year
incapr() Incapacitation under desistance and replacement
sellab() Evaluating a release rule from the released alone
losbnd() Mean time in custody from completed and current stays
sntbnd() Bounds on a sentence’s effect without assumptions
hzdsel() Period-two hazards after selective depletion

Co-offending graphs, centrality, cores, components, communities, brokerage and the Cheeger bounds.

Function What it computes
coofg() Co-offending graph from an incident table
ntdeg() Degree and strength of each node
ntbtw() Betweenness of each node
ntcls() Closeness of each node
ntevc() Eigenvector centrality of each node
ntcore() k-core of each node
ntcmp() Connected components
ntlvn() Communities by the Louvain method
ntmod() Modularity of a partition
ntbrk() Brokerage roles
ntchg() Cheeger bounds on a network’s bottleneck

Distances and projection, centrography, nearest neighbours and K functions, hot spots, space-time tests and journey to crime.

Function What it computes
hvdist() Great-circle distance
eqproj() Equal-area projection of longitude and latitude, and its inverse
cgstat() Mean centre and dispersion of points
cgmedn() Median centre of points
webpt() Centre of minimum distance
sdell() Standard deviational ellipse
cvhull() Convex hull of points
nnidx() Nearest-neighbour index
ripk() Ripley’s K function
ripenv() Envelopes of Ripley’s L function and a test of complete spatial randomness
fzmode() Fuzzy mode
kmpart() K-means partition of points
nnhclu() Nearest-neighbour hierarchical clustering
stacel() Search-circle hot-spot areas
rnnhcl() Risk-adjusted nearest-neighbour hierarchical clustering
hdbang() Head-bang smoothing
crwalk() Correlated random walk of a series of events
mantst() Mantel’s space-time test
stmavg() Spatial-temporal moving average
jtdecay() Distance-decay functions for journey to crime
jtsurf() Journey-to-crime surface
jtcal() Empirical distance decay from solved trips
jtacc() Accuracy of a journey-to-crime surface on a solved series
bjtc() Bayesian journey to crime
spwt() Spatial weights
gearc() Geary’s C
gorg() The general G of Getis and Ord
lmorn() Local Moran (LISA)
locgi() Local G and G* of Getis and Ord
dirmn() Directional mean and circular variance

Fairness of risk tools, trace evidence, aoristic time, Benford screens, glass grouping and transfer, constant reporters, sensitivity bounds, trajectory models, lowess, tool marks, grid Gi* and the point pattern test.

Function What it computes
fair() Fairness metrics of a binary risk tool by group
tlvc() Two-level model for multivariate trace evidence
aorwt() Aoristic weights
bdig() Benford digit screens
skp() Scott-Knott grouping of measurements
rptc() Constant reporters of a reporting panel
rswp() Rosenbaum sensitivity bounds for matched pairs
zgll() Group-based trajectory model for counts
mvtll() Group-based multivariate trajectories
tfrp() Glass fragments recovered under transfer and persistence
lwss() Lowess smoothing
chmb() The Chumbley score for two tool-mark profiles
gstr() Local Getis-Ord Gi* on a grid of counts
sptst() Andresen’s spatial point pattern test

Which labelling of a table reproduces a reported contrast, and an audit of categorical inputs.

Function What it computes
relchk() Which labelling reproduces a reported contrast?
catchk() Audit categorical inputs before an analysis

Rate ratios from count regression with exposure and clusters; rates and proportions by group with exact and approximate intervals; direct and indirect standardisation; cross-tabulation with tests and measures of association.

Function What it computes
cntreg() Count regression: rate ratios between groups
grprr() Rates and proportions by group: ratios and differences
dastd() Directly standardised rates
sirex() Indirect standardisation: standardised ratios with shrinkage
ctabx() Cross-tabulation with tests and measures of association

A published dataset’s columns onto a generic function’s arguments.

Function What it computes
clprep() Presets: a published dataset’s columns onto a generic function’s arguments

The elastic net with cross-validation, logistic regression and random forests; the learners of the cross-fitted estimators.

Function What it computes
enpath() Elastic net by coordinate descent, with cross-validation
lgtreg() Logistic regression
rfor() Random forest for regression and probabilities

Double machine learning by cross-fitting, with the learners above; augmented inverse probability weighting and targeted maximum likelihood from the same nuisances.

Function What it computes
dmlx() Double machine learning by cross-fitting
Function What it computes
proof() Machine-checked proofs behind the package
Function What it computes
crimlab-package() crimlab: Criminology and Sociolegal Statistics