Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/two.level.density.LR.r

Takes a `compitem`

object which represents some control item, and a `compitem`

object which represents a recovered item, then uses information from a `compcovar`

object, which represents the information from the population, to calculate a likelihood ratio as a measure of the evidence given by the observations for the same/different source propositions.

1 | ```
two.level.density.LR(control, recovered, background)
``` |

`control` |
a |

`recovered` |
a |

`background` |
a |

Does the likelihood ratio calculations for a two-level model without assuming that the between items distribution is uni/multivariate normal.

Returns an estimate of the likelihood ratio

Do not even think about using this function without the proper `compcovar`

and `compitem`

objects - it will not work.

David Lucy [email protected] - http://www.maths.lancs.ac.uk/~lucy

Aitken, C.G.G. & Lucy, D. (2004) Evaluation of trace evidence in the form of multivariate data. *Applied Statistics*: **53**(1); 109-122.

`compcovar`

`compitem`

`two.level.comparison.items`

`two.level.components`

`two.level.normal.LR`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ```
# load this library
library(comparison)
# load Greg Zadora's glass data
data(glass)
# make it into a data frame
dat <- as.data.frame(glass)
# calculate a compcovar object based upon dat
# using K, Ca and Fe - warning - could take time
# on slower machines
Z <- two.level.components(dat, c(7,8,9), 1)
# calculate a compitem object representing the control item
control <- two.level.comparison.items(dat[1:6,], c(7,8,9))
# calculate a compitem object representing the recovered item
# known to be from the same item (item 1)
recovered.1 <- two.level.comparison.items(dat[7:12,], c(7,8,9))
# calculate a compitem object representing the recovered item
# known to be from a different item (item 2)
recovered.2 <- two.level.comparison.items(dat[19:24,], c(7,8,9))
# calculate the likelihood ratio for a known
# same source comparison - should be 20.59322
lr.1 <- two.level.density.LR(control, recovered.1, Z)
# calculate the likelihood ratio for a known
# different source comparison - should be 0.02901532
lr.2 <- two.level.density.LR(control, recovered.2, Z)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.