Reads mixture data from files, computes the likelihood ratio for the given hypotheses and finally calculates a p-value corresponding to the likelihood ratio. The p-value is the probability of observing a likelihood ratio at least as large as the one observed, given that the defense hypothesis is true.

1 | ```
LRpvalue(samplefile, victimfile, suspectfile, freqfile, hp, hd, prD, prC)
``` |

`samplefile` |
CSV file with sample profile. The file can only contain data for autosomal markers, and apart from that the format is the same as required in LRmix. See the LRmix manual for details. The file name must contain the complete path if the file is not in the current working directory. |

`victimfile` |
CSV file with victim profile. Same format as in LRmix. Only autosomal markers. |

`suspectfile` |
CSV file with suspect profile. Same format as in LRmix. Only autosomal markers. |

`freqfile` |
CSV file with allele frequencies. Same format as in LRmix. |

`hp` |
Prosecution hypothesis. A character vector of all contributors under $H_p$, where S denotes suspect, V victim and U unknown. E.g. if the hypothesis is that the sample is a mixture of the suspect, the victim and one unknown, this is specified with the vector c('S','V,'U'). |

`hd` |
Defense hypothesis. A character vector of all contributors under $H_d$, specified like hp. E.g. if the hypothesis is that the sample is a mixture of the suspect, and two unknowns, this is specified with the vector c('S','U,'U'). |

`prD` |
Probability of drop-out. A number between 0 and 1. |

`prC` |
Probability of drop-in. A number between 0 and 1. |

The function is a wrapper for `LRp`

which again is a wrapper for `pvalue.machine`

. Likelihood ratios are computed with the `LR`

function in `forensim`

. For liberties regarding reading data from files, `LRp`

can be used to compute p-values for already prepared data frames. For liberty also regarding the LR model used, `pvalue.machine`

is the most generic function to compute a p-value.

`LR` |
Likelihood ratio |

`pvalue` |
P-value corresponding to the likelihood ratio |

Guro Dorum <guro.dorum@nmbu.no>

Dorum et al. Exact computation of the distribution of likelihood ratios with forensic applications. FSI: Genetics, 9, 2014, doi: http://dx.doi.org/10.1016/j.fsigen.2013.11.008

1 2 3 4 5 6 7 8 9 | ```
data(sample);data(suspect);data(victim);data(freqs)
samplefile <- tempfile(); write.table(sample, samplefile, sep=",", row.names=FALSE)
victimfile <- tempfile(); write.table(victim, victimfile, sep=",", row.names=FALSE)
suspectfile <- tempfile(); write.table(suspect, suspectfile, sep=",", row.names=FALSE)
freqfile <- tempfile(); write.table(freqs, freqfile, sep=",", row.names=FALSE)
LRpvalue(samplefile, victimfile, suspectfile, freqfile, hp=c("V","S"), hd=c("V","U"),
prD=0.47, prC=0.05)
unlink(c(samplefile, victimfile, suspectfile, freqfile))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

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.