getBF {crimelinkage}R Documentation

Estimates the bayes factor for continous and categorical predictors.

Description

This adds pseudo counts to each bin count to give df effective degrees of freedom. Must have all possible factor levels and must be of factor class.

Usage

getBF(x, y, weights, breaks = NULL, df = 5)

Arguments

x

predictor vector (continuous or categorical/factors)

y

binary vector indicating linkage (1 = linked, 0 = unlinked) or logical vector (TRUE = linked, FALSE = unlinked)

weights

a vector of observation weights or the column name in data that corresponds to the weights.

breaks

set of break point for continuous predictors or NULL for categorical or discrete

df

the effective degrees of freedom for the cetegorical density estimates

Details

Continous predictors are first binned, then estimates shrunk towards zero.

Value

data.frame containing the levels/categories with estimated Bayes factor

Note

Give linked and unlinked a different prior according to sample size

Examples

# See vignette: "Statistical Methods for Crime Series Linkage" for usage.

[Package crimelinkage version 0.0.4 Index]