| Title: | Data Analysis for Forensic Scientists |
|---|---|
| Description: | Data and miscellanea to support the book "Introduction to Data analysis with R for Forensic Scientists." This book was written by James Curran and published by CRC Press in 2010 (ISBN: 978-1-4200-8826-7). |
| Authors: | James Curran, Danny Chang |
| Maintainer: | James Curran <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0-38 |
| Built: | 2026-05-25 10:25:05 UTC |
| Source: | https://github.com/cran/dafs |
The amount of DNA left on different types of drinking containers.
data(abaz.df)data(abaz.df)
A data frame with 21 columns.
| [,1] | person | factor | A label (A..F) for the 6 experimental subjects |
| [,2] | sample | factor | A treatement factor indicating the different beverage/container combinations |
| [,3] | ab.sample | factor | An abbreviated treatment label |
| [,4] | time | factor | time when DNA concentration was measured. Levels: 24hrs, 48hrs |
| [,5] | amylase | numeric | the relative amount of alpha-amylase activity |
| [,6] | quant | numeric | |
| [,7] | amp.volume | numeric | |
| [,8] | dna.conc | numeric | |
| [,9] | gel.profile | factor | |
| [,10] | failed.profile | factor | the failure or success of obtaining a usable DNA profile |
| [,11:21] | d3..fga | numeric | Total peak heights at each locus |
Abaz et al.
Abaz, J., Walsh, S.J., Curran, J.M., Moss, D.S., Cullen, J., Bright, J.A., Crowe, G.A., Cockerton, S.L. and Power, T.E. 'Comparison of the variables affecting the recovery of DNA from common drinking containers' Forensic Sci Int. 2002 May 23;126(3):233-40.
This data was studied to investigate whether there was a relationship between whether the victim had been abducted and the age of the victims in certain crimes. The age of the victims had been classiffed as 0-10 and 11+.
data(abduct.age.df)data(abduct.age.df)
C. G. G. Aitken, T. Connolly, A. Gammerman, G. Zhang, D. Bailey, R. Gordon, and R. Oldfield. Statistical modelling in specific case analysis. Science & Justice, 36(4):245-255, October 1996.
Rushton was interested in the effect of annealing on the refractive index of glass. It is well known that annealing float glass changes the refractive index (RI). The change in RI - called delta-RI - can tell a forensic scientist something about the glass that they are examining.
In this data set, 3 replicate measurements were made from 150 squares of glass from a single pane. Each fragment was measured pre and post annealing.
data(anneal.df)data(anneal.df)
A data frame with 900 observations on 3 variables.
| [,1] | ri | numeric | The fragment's refractive index |
| [,2] | temp | numeric | The fragment's match temperature - this will be almost perfectly correlated with ri |
| [,3] | anneal | factor | either pre or post for pre or post annealing |
K.P. Rushton
Rushton, K.P., Analysis of the variation of glass refractive index with respect to annealing, (2009) MSc Thesis, Forensic Science, University of Auckland.
This data is known as the Anscombe quartet. Each of sets has two variables, x and y. In each data set, x and y have the same mean (9 and 7.5), the same standard deviation (3.32 and 2.03) and the same correlation (0.82).
data(anscombe.df)data(anscombe.df)
F. J. Anscombe. Graphs in statistical analysis. The American Statistician, 27(1):17-21, 1973.
This data has 10 rows and 49 columns corresponding 10 refractive index (RI) measurements from 49 different locations in a windowpane.
data(bennett.df)data(bennett.df)
R. L. Bennett, N. D. Kim, J. M. Curran, S. A. Coulson, and A. W. N. Newton. Spatial variation of refractive index in a pane of float glass. Science & Justice, 43(2):71-76, April 2003.
This data contains the elemental concentration of five different elements (Manganese, Barium, Strontium, Zirconium, and Titanium) in samples of glass taken from six different Heineken beer bottles at four different locations (Base, Body, Shoulder, and Neck). Five repeat measurements are made on each sample at each location.
data(bottle.df)data(bottle.df)
R. L. Bennett. Aspects of the analysis and interpretation of glass trace evidence. Master's thesis, Department of Chemistry, University of Waikato, 2002.
This data has 10 refractive index (RI) measurement from recovered glass fragments and .....
data(casework.df)data(casework.df)
James Curran
This data has genotype of Cholecystokinin (CCK) gene promoter regions of -196G/A from selected suicide victims (S) and from control subjects (C).
data(cck196.df)data(cck196.df)
Shindo S, Yoshioka N. Polymorphisms of the cholecystokinin gene promoter region in suicide victims in Japan. Forensic Science International, 150(1):85-90, May 2005.
This data has genotype of Cholecystokinin (CCK) gene promoter regions of -45C/T from selected suicide victims (S) and from control subjects (C).
data(cck45.df)data(cck45.df)
S. Shindo and N. Yoshioka. Polymorphisms of the cholecystokinin gene promoter region in suicide victims in Japan. Forensic Science International, 150(1):85-90, May 2005.
This data has number of misleading signatures in comparisons of 16 genuine signatures and 64 simulated signatures from 15 document examiners.
data(docexam.df)data(docexam.df)
B. Found and D. K. Rogers. Investigating forensic document examiners' skill relating to opinions on photocopied signatures. Science & Justice, 45(4):199-206, 2005.
This data measured deoxypyridinoline (DPD) to estimate human age. DPD is a nonreducible collagen crosslink that can be measured in human dentin samples extracted from permanent individual molars. Measurements were made in dentin samples from 22 patients with ages ranging from 15 to 73.
data(dpd.df)data(dpd.df)
S. Martin-de las Heras, A. Valenzuela, and E. Villanueva. Deoxypyridinoline crosslinks in human dentin and estimation of age. International Journal of Legal Medicine, 112(4):222-226, June 1999.
This data comes from a population study of textile fibres in human hair in Cambridgeshire, UK, 2002. It was carried out using 26 volunteers, and 12149 fibres were recovered from a variety of hair lengths using low adhesive tape and classified according to colour, generic type and fibre length. This data has percentage distribution of fibres in head hair according to colour.
data(fiber.color.df)data(fiber.color.df)
R. Palmer and S. Oliver. The population of coloured fibres in human head hair. Science & Justice, 44(2):83-88, April 2004.
This functions the P-value from the (null) hypothesis that all of the linear predictors are zero or not-significant.
fitPvalue(fit)fitPvalue(fit)
fit |
a |
summary returns an invisible vector called fstatistic that
contains the F-statistic and the degrees of freedom used to test the
hypothesis that all of the linear predictors are zero or
not-significant. This function takes those values and returns the
appropriate upper tail probability from the F-distribution.
A P-value
James Curran
x = runif(100,1,10) y = 2 + 3*x + rnorm(100) fit = lm(y~x) fitPvalue(fit)x = runif(100,1,10) y = 2 + 3*x + rnorm(100) fit = lm(y~x) fitPvalue(fit)
Format a number in standard scientific format XXX.XXEXXX into a string that can be typeset by LaTeX
formatScientificTeX(x, width, digits)formatScientificTeX(x, width, digits)
x |
The number to be formatted. This number does not need to be in scientific format. |
width |
|
digits |
See |
If x = 300.123, width = 4 and digits = 1, then this
function will return " 3.0\\times 10^2"
A string that will format in a LaTeX inline math environment.
James Curran
fmtST(300.123, 1, 4)fmtST(300.123, 1, 4)
This data has the human group-specific component (Gc) genotypes of African Americans, Caucasians, and South Western Hispanics. The Gc locus has alleles A, B, and C and hence, the possible genotype are AA, AB, AC, BB, BC, and CC.
data(gc.df)data(gc.df)
FBI reference database
This data comes from a gamma-hydroxybutyric acid (GHB) experiment, which has three groups of individuals: (1) volunteers with no alcoholic history, (2) alcoholics who were waiting to start a GHB treatment program but had not yet received the drug, (3) alcoholics currently being treated with GHB, and measured the endogenous GHB concentration (ug/mL) in each.
data(ghb.df)data(ghb.df)
F. Mari, L. Politi, C. Trignano, M. Grazia Di Milia, M. Di Padua, and E. Bertoli. What constitutes a normal ante-mortem urine GHB concentration? Journal of Forensic and Legal Medicine, 16(3):148-151, April 2009.
This data is collected from 41 teeth, which were scored on a number of variables.
data(gustafson.df)data(gustafson.df)
G. Gustafson. Age determinations on teeth. Journal of the American Dental Association, 41(1):45-54, 1950.
Produce a half normal plot for a fitted lm or glm
object. This function should work for any class that implements
residuals.
halfnorm(fit)halfnorm(fit)
fit |
A |
The absolute value of the residuals are plotted against the positive quantiles of the normal distribution. The largest 5 percent of the empirical quantiles are labelled to help identify potential outliers.
No values are returned.
The labelling of the largest 5 percent is utterly arbitrary.
J.M. Curran
This is a modified version of the function interactionPlots
from the s20x library which produces greyscale plots.
Displays data with intervals for each combination of the two factors and shows the mean differences between levels of the first factor for each level of the second factor. Note that there should be more than one observation for each combination of factors.
intPlot(y, ...) ## Default S3 method: intPlot(y, fac1 = NULL, fac2 = NULL, xlab = NULL, xlab2 = NULL, ylab = NULL, data.order = TRUE, exlim = 0.1, jitter = 0.02, conf.level = 0.95, interval.type = "tukey", pooled = TRUE, tick.length = 0.1, interval.distance = 0.2, col.width = 2/3, xlab.distance = 0.1, xlen = 1.5, ylen = 1, ...) ## S3 method for class 'formula' intPlot(y, data, xlab = NULL, xlab2 = NULL, ylab = NULL, data.order = TRUE, exlim=0.1, jitter=0.02, conf.level=0.95, interval.type = "tukey", pooled = TRUE, tick.length = 0.1, interval.distance = 0.2, col.width = 2/3, xlab.distance = 0.1, xlen=1.5, ylen = 1, ...)intPlot(y, ...) ## Default S3 method: intPlot(y, fac1 = NULL, fac2 = NULL, xlab = NULL, xlab2 = NULL, ylab = NULL, data.order = TRUE, exlim = 0.1, jitter = 0.02, conf.level = 0.95, interval.type = "tukey", pooled = TRUE, tick.length = 0.1, interval.distance = 0.2, col.width = 2/3, xlab.distance = 0.1, xlen = 1.5, ylen = 1, ...) ## S3 method for class 'formula' intPlot(y, data, xlab = NULL, xlab2 = NULL, ylab = NULL, data.order = TRUE, exlim=0.1, jitter=0.02, conf.level=0.95, interval.type = "tukey", pooled = TRUE, tick.length = 0.1, interval.distance = 0.2, col.width = 2/3, xlab.distance = 0.1, xlen=1.5, ylen = 1, ...)
y |
either a formula of the form: y~fac1+fac2 where y is the response and fac1 and fac2 are the two explanatory variables used as factors, or a single response vector |
fac1 |
if 'y' is a vector, then fac1 contains the levels of factor 1 which correspond to the y value |
fac2 |
if 'y' is a vector, then fac1 contains the levels of factor 2 which correspond to the y value |
data |
an optional data frame containing the variables in the model. |
xlab |
an optional label for the x-axis. If not specified the name of fac1 will be used. |
xlab2 |
an optional label for the lines. If not specified the name of fac2 will be used. |
ylab |
An optional label for the y-axis. If not specified the name of y will be used. |
data.order |
if TRUE the levels of fac1 and fac2 will be set to unique(fac1) and unique(fac2) respectively. |
exlim |
provide extra limits. |
jitter |
the amount of horizontal jitter to show in the plot. The actual jitter is determined as the function is called, and will likely be different each time the function is used. |
conf.level |
confidence level of the intervals. |
interval.type |
four options for intervals appearing on plot: "tukey", "hsd", "lsd" or "ci". |
pooled |
two options: pooled or unpooled standard deviation used for plotted intervals. |
tick.length |
size of tick, in inches. |
interval.distance |
distance, as a fraction of the column width, between the points and interval. This is in addition to the extra space allocated for the jitter. |
col.width |
width of a factor ‘column’, as a fraction of the space between the centres of two columns. |
xlab.distance |
distance of x-axis labels from bottom of plot, as a fraction of the overall height of the plot. |
xlen, ylen
|
xxx |
... |
optional arguments. |
library(s20x) data(mtcars) intPlot(wt~vs+gear, mtcars)library(s20x) data(mtcars) intPlot(wt~vs+gear, mtcars)
This data comes from a pilot experiment, which fired a sequence of 10 shots through a set of six paper targets that were equally spaced from 3 ft to 18 ft and recorded the size of the pellet pattern at 18 ft. They then repeated the experiment with five of the targets removed and a single target at 18 ft. The third variable indicate with and without intermediate targets.
data(jauhari1.df)data(jauhari1.df)
M. Jauhari, S. M. Chatterjee, and P. K. Ghosh. Statistical treatment of pellet dispersion data for estimating range of firing. Journal of Forensic Sciences, 17(1):141-149, 1972.
This data comes from a pilot experiment by Jauhari et al. They fired a sequence of 10 shots through a set of six paper targets that were equally spaced from 3 ft to 18 ft and recorded the size of the pellet pattern at 18 ft.
data(jauhari2.df)data(jauhari2.df)
M. Jauhari, S. M. Chatterjee, and P. K. Ghosh. Statistical treatment of pellet dispersion data for estimating range of firing. Journal of Forensic Sciences, 17(1):141-149, 1972.
In this data set are the results of 93 human cadaver crash tests. The tests were used in the development of thoracic injury risk functions with consideration of age and restraint condition. The data can be used with logistic regression models by recoding the variable fracture into <6 and >=6, or with a Poisson/quasi-Poisson/negative binomial GLM.
data(kent.df)data(kent.df)
A data frame with ... variables
Kent. R, and Petrie, J.
Kent, R. and Petrie, J., Chest deflection tolerance to blunt anterior loading is sensitive to age but not load distribution , Forensic Science International 149(2004):2-3 p.121-128.
data(kent.df) ##recode the response fracture to minor injury (<6 rib fractures) and ##severe injury (>=6 rib fractures) ##kent.df = within(kent.df, { ## injury = factor(ifelse(fractures<6,'minor','severe'), ## levels = c('severe','minor'))}) ## fit a binomial GLM ## kent.fit = glm(injury~cmax*data(kent.df) ##recode the response fracture to minor injury (<6 rib fractures) and ##severe injury (>=6 rib fractures) ##kent.df = within(kent.df, { ## injury = factor(ifelse(fractures<6,'minor','severe'), ## levels = c('severe','minor'))}) ## fit a binomial GLM ## kent.fit = glm(injury~cmax*
This data was analyzed the process of Kerckring on the occipital bone of numbers black and white perinates. The process of Kerckring is a projection of bone occasionally observed emerging from the inferior margin of the supraoccipital portion of the occipital squamous at the midline. Its status was regarded as either absent or present.
data(kerckring.df)data(kerckring.df)
S. M. Weinberg, D. A. Putz, M. P. Mooney, and M. I. Siegel. Evaluation of non-metric variation in the crania of black and white perinates. Forensic Science International, 151(2-3):177-185, July 2005.
Return the last element of a vector
last(x)last(x)
x |
a vector |
James Curran
x = 1:10 last(x)x = 1:10 last(x)
The data record information on the presence or absence of extramedullary haematopoiesis (EMH) symptoms in 51 liver of sudden infant death (SIDS) and 102 non-SIDS cases.
data(liver.df)data(liver.df)
K. Toro, M.Hubay, and E. Keller. Extramedullary haematopoiesis in liver of sudden infant death cases. Forensic Science International, 170(1):15-19, July 2007.
Data was compiled from 126 morphine-involved cases investigated by the Office of the Chief Medical Examiner, State of Maryland, USA. An investigation was conducted into whether comparison of morphine concentrations from a central and peripheral site could be used to determine whether a morphine death was acute or delayed. Fifty cases were identified as 'acute' because the urine free morphine concentration by radioimmunoassay (RIA) was less than 25 nglmL; 76 cases were classified as 'random' because they had a urine morphine concentration greater than 25 ng/mL by RIA. The average heart blood to peripheral blood morphine concentration ratio in the acute deaths was 1.40. The average heart blood to peripheral blood morphine concentration ratio in the random deaths was 1.18. Because there was considerable overlap between the two groups of data, the authors conclude that it was not possible to predict 'acute' opiate intoxication deaths versus 'delayed' deaths when the only information available is heart and peripheral blood free morphine concentrations.
data(morphine.df)data(morphine.df)
Levine et al.
B. Levine, D. Green-Johnson, K.A. Moore, D. Fowler, A. Jenkins, Assessment of the acuteness of heroin deaths from the analysis of multiple blood specimens, Science & Justice, Volume 42, Issue 1, January 2002, Pages 17-20.
This data was analyzed the projection of the anterior nasal spine on the maxillae of numbers black and white perinates. The anterior nasal spine was assessed by its forward projection away from the frontal plane of the anterior maxillary surface. This was best assessed from the lateral and/or superior perspective. Projection was described as slight, moderate or pronounced.
data(nasal.spline.df)data(nasal.spline.df)
S. M. Weinberg, D. A. Putz, M. P. Mooney, and M. I. Siegel. Evaluation of non-metric variation in the crania of black and white perinates. Forensic Science International, 151(2-3):177-185, July 2005.
This data has refractive index (RI) measurements for 30 fragments on each of the five strata - float surface (FS), near float surface (NFS), bulk (B), near anti-float (NAFS), and anti-float (AFS).
data(newton.df)data(newton.df)
A. W. N. Newton, J. M. Curran, C. M. Triggs, and J. S. Buckleton. The consequences of potentially differing distributions of the refractive indices of glass fragments from control and recovered sources. Forensic Science International, 140(2?3):185-193, March 2004.
This data has refractive index (RI) measurements made on glass fragments recovered in New Zealand case work.
data(nzglass.df)data(nzglass.df)
John Buckleton, Sally Coulson, Tony Gummer, Angus Newton, Gerhard Wevers, Kevan Walsh (and ESR)
This is a modified verison of the pairs20x function
from the s20x library which produces greyscale plots.
Plots pairwise scatter plots with histograms and correlations for the data frame.
pairsDAFS(x, ...)pairsDAFS(x, ...)
x |
a data frame. |
... |
optional argumments which are passed to the generic pairs function. |
Returns the plots.
##peruvian indians library(s20x) data(peru.df) pairsDAFS(peru.df)##peruvian indians library(s20x) data(peru.df) pairsDAFS(peru.df)
This data was analyzed the shape of the palatal arch on the maxillae of numbers black and white perinates. Palatal arch shape was determined by the curve formed by the inner alveolar margin. In order to determine shape, the separate maxillary halves were joined together at the midline. If the inner alveolar margins were observed to converge gradually along a continuous arc towards the midline, the palate was considered parabolic. On the other hand, if the inner alveolar margins were parallel to each other without converging until anterior of the premolars, the palate was considered hyperbolic. If the palate fell somewhere in between, it was considered intermediate.
data(palatal.df)data(palatal.df)
S. M. Weinberg, D. A. Putz, M. P. Mooney, and M. I. Siegel. Evaluation of non-metric variation in the crania of black and white perinates. Forensic Science International, 151(2-3):177-185, July 2005.
Produce simulataneous postscript and pdf images using a user defined plot function.
plotBoth(plotfn, filename, control = plotBoth.control(), ...)plotBoth(plotfn, filename, control = plotBoth.control(), ...)
plotfn |
A function containing the plotting commands |
filename |
The name of the output file - .eps and .pdf will be appended to the postscript and pdf images respectively |
control |
The results of |
... |
Any additional arguments that need to be fed to plotfn |
J.M. Curran
plotBoth.control
## Not run: plotBoth(function(){ plot(rnorm(100),rnorm(100))}, 'test') ## End(Not run)## Not run: plotBoth(function(){ plot(rnorm(100),rnorm(100))}, 'test') ## End(Not run)
Gives user control over font embedding and plot generation.
plotBoth.control(genPlots = .genPlots, embedF = .embedF, embedFoptions = .embedFoptions)plotBoth.control(genPlots = .genPlots, embedF = .embedF, embedFoptions = .embedFoptions)
genPlots |
TRUE or FALSE depending on whether plotBoth should produce a plot |
embedF |
TRUE or FALSE depending on whether font embedding is desired |
embedFoptions |
A string containing all the font embedding options to be sent to Ghostscript |
A list containing the values of the variables genPlots, embedF, and embedFoptions
J Curran
Produces 3 plots in a 2 x 2 array. The plots are a plot of residuals versus predicted values (pred-res plot), a histogram of the residuals with a normal distribution superimposed, and a normal QQ-plot of the residuals.
plotRegDiagPlots(fit)plotRegDiagPlots(fit)
fit |
A |
J Curran
plot.lm
x = runif(100) y = 3*x+2+dnorm(100) fit = lm(y~x) plotRegDiagPlots(fit)x = runif(100) y = 3*x+2+dnorm(100) fit = lm(y~x) plotRegDiagPlots(fit)
Formats the column headings an table for a GLM using the input of xtable.
printANODEVTable(xtbl, sanitize.text.function = function(x){x}, test = NULL, ...)printANODEVTable(xtbl, sanitize.text.function = function(x){x}, test = NULL, ...)
xtbl |
The output of |
sanitize.text.function |
Don't change this |
test |
"Chisq" or "F" depending on the desired test |
... |
Extra arguments to be fed to |
A LaTeX formatted ANODEV table
J Curran
print.xtable
Formats the column headings an ANOVA table for a normal GLM using the input of xtable.
printANOVATable(xtbl, sanitize.text.function = function(x){x}, ...)printANOVATable(xtbl, sanitize.text.function = function(x){x}, ...)
xtbl |
The output of |
sanitize.text.function |
Don't change this |
... |
Extra arguments to be fed to |
A LaTeX formatted ANOVA table
J Curran
print.xtable
Takes a vector of length two and prints out a confidence interval in a user specified format.
printCI(x, fmt)printCI(x, fmt)
x |
A vector of length two containing the lower and upper bounds of a confidence interval |
fmt |
A format string to be used by |
A string containing the formatted CI
James Curran
sprintf
n = 100 x = rnorm(n) mx = mean(x) se = sd(x)/sqrt(n) ci = mx + qnorm(c(0.025,0.975))*se printCI(ci, '%5.2f')n = 100 x = rnorm(n) mx = mean(x) se = sd(x)/sqrt(n) ci = mx + qnorm(c(0.025,0.975))*se printCI(ci, '%5.2f')
Formats the column headings a regression table using the input of xtable.
printRegTable(xtbl, sanitize.text.function = function(x){x}, test = 't', ...)printRegTable(xtbl, sanitize.text.function = function(x){x}, test = 't', ...)
xtbl |
The output of |
sanitize.text.function |
Don't change this |
test |
"t" or "z" depending on the desired test |
... |
Extra arguments to be fed to |
A LaTeX formatted regression table
J Curran
print.xtable
Produces a math-mode formatted string for a P-value.
pvalue(p, fmt = "$P = %6.4f$")pvalue(p, fmt = "$P = %6.4f$")
p |
The P-value |
fmt |
A formatting string for LaTeX |
A string that will be correctly formatted by LaTeX
J Curran
Sweave
p = 0.04 pvalue(p)p = 0.04 pvalue(p)
This data is combined from two calibration experiments which are conduct by Dr. Grzegorz Zadora and Bennett. The factor owner has two levels, RB for Rachel Bennett, and GZ for Grzegorz Zadora. The calibration of the instrument was established using standard glasses (Locke Scientific) set B1-B12 (RI=1.52912-1.520226).
data(ri.calibration.df)data(ri.calibration.df)
Dr. Grzegorz Zadora from the Institute for Forensic Research in Krakow, Poland. R. L. Bennett. Aspects of the analysis and interpretation of glass trace evidence. Master's thesis, Department of Chemistry, University of Waikato, 2002.
This data comes from a 2nd generation Glass Refractive Index Measurer (GRIM2) calibration experiment. The calibration of the instrument was established using standard glasses (Locke Scientific) set B1-B12 (RI=1.52912-1.520226). Each of the twelve reference sample glasses B1-B12 was measured five times.
data(ri.calibration2.df)data(ri.calibration2.df)
Dr. Grzegorz Zadora from the Institute for Forensic Research in Krakow, Poland.
Produces a math-mode formatted string for R-squared.
Rsq(R, fmt = "$R^2 = %6.4f$", adj = FALSE)Rsq(R, fmt = "$R^2 = %6.4f$", adj = FALSE)
R |
The R-squared value |
fmt |
A formatting string for LaTeX |
adj |
If TRUE appends 'adjusted ' to the format string |
A string that will be correctly formatted by LaTeX
J Curran
Sweave
r = 0.99 Rsq(r)r = 0.99 Rsq(r)
Blood alcohol measurements determined by headspace gas chromatography have been challenged on the grounds that the presence of the preservative sodium fluoride in blood samples artificially increases headspace alcohol concentrations due to a salting out effect. Blood samples containing varying amounts of ethanol and sodium fluoride (NaF) were tested using semi-automated headspace gas chromatography with n-propyl alcohol as the internal standard to assess the validity of this challenge. Miller et al found, in fact, that under these test conditions the measured alcohol levels are systematically depressed as the amount of sodium fluoride in the blood sample increases.
Blood was drawn from each of six subjects near the time of estimated peak blood alcohol concentration. Each subject had three blood samples taken to which 0, 5, and 10mg/mL of NaF were added. The blood alcohol concentration for each tube was determined twice for each tube
data(salting1.df)data(salting1.df)
A data frame containing four variables
| [,1] | subject | numeric factor | subject identifier 1-6 |
| [,2] | tube | numeric factor | tube 1,2,3 for each subject |
| [,3] | rep | numeric factor | levels 1,2 indicating replicate measurement |
| [,4] | NaF | numeric factor | the level of sodium fluoride added in mg/mL |
| [,5] | conc | numeric | alcohol concentration in g/100mL |
Note that the blocking and treatment factors in this data frame are
numeric. Therefore, to use them as such will require the use of factor
or ordered.
B. A. Miller et al.
B.A. Miller, S.M. Day, T.E. Vasquez, F.M. Evans, Absence of salting out effects in forensic blood alcohol determination at various concentrations of sodium fluoride using semi-automated headspace gas chromatography, Science & Justice, Volume 44, Issue 2, April 2004, Pages 73-76.
Blood alcohol measurements determined by headspace gas chromatography have been challenged on the grounds that the presence of the preservative sodium fluoride in blood samples artificially increases headspace alcohol concentrations due to a salting out effect. Blood samples containing varying amounts of ethanol and sodium fluoride (NaF) were tested using semi-automated headspace gas chromatography with n-propyl alcohol as the internal standard to assess the validity of this challenge. Miller et al found, in fact, that under these test conditions the measured alcohol levels are systematically depressed as the amount of sodium fluoride in the blood sample increases.
Blood was drawn from each of four subjects at two time points, first near the time of estimated peak blood alcohol concentration and then approximately 1.5 hours later. Samples were initially analyzed with NaF at manufacturer's levels (ca. 10 mg/mL).
data(salting2.df)data(salting2.df)
A data frame containing four variables
| [,1] | subject | numeric factor | subject identifier 1-4 |
| [,2] | time | numeric factor | time sample taken 0 or 1.5h |
| [,3] | NaF | numeric factor | the level of sodium fluoride added in mg/mL |
| [,4] | EtOH | numeric | alcohol concentration in g/100mL |
Note that the blocking and treatment factors in this data frame are
numeric. Therefore, to use them as such will require the use of factor
or ordered.
B. A. Miller et al.
B.A. Miller, S.M. Day, T.E. Vasquez, F.M. Evans, Absence of salting out effects in forensic blood alcohol determination at various concentrations of sodium fluoride using semi-automated headspace gas chromatography, Science & Justice, Volume 44, Issue 2, April 2004, Pages 73-76.
This data is collected gender and age of victims in certain crimes. The age of the victims had been classified as 0-10 and 11+.
data(sex.age.df)data(sex.age.df)
C. G. G. Aitken, T. Connolly, A. Gammerman, G. Zhang, D. Bailey, R. Gordon, and R. Oldfield. Statistical modelling in specific case analysis. Science & Justice, 36(4):245-255, October 1996.
Useful for shading regions of interest (critical regions perhaps) on a theoretical pdf to illustrate concepts such as P-values.
shadeDens(x0, x1, dens, col = "lightgrey", n.points = 200, lty = 1,...)shadeDens(x0, x1, dens, col = "lightgrey", n.points = 200, lty = 1,...)
x0 |
A starting x-value for the region to be shaded |
x1 |
An ending x-value for the region to be shaded |
dens |
A function that calculates the pdf |
col |
A color for the shaded region |
n.points |
The number of points to calculate the pdf at over the interval [x0,x1] |
lty |
Line type |
... |
Additional arguments to be fed to |
Adds a filled polygon to an existing pdf plot.
J Curran
x = seq(-4.5,4.5,by = 0.01) plot(x, dnorm(x), type = 'l') x0 = qnorm(0.975) x1 = 4.5 shadeDens(x0, x1, dnorm)x = seq(-4.5,4.5,by = 0.01) plot(x, dnorm(x), type = 'l') x0 = qnorm(0.975) x1 = 4.5 shadeDens(x0, x1, dnorm)
In order to test the validity of range-of-fire estimates obtained by the application of regression analysis to shotgun pellet patterns, a blind study was conducted in which questioned pellet patterns were fired at randomly selected ranges between 3.0 and 15.2 m (10 and 50 ft) with two different 12-gauge shotguns. each firing a different type of buckshot cartridge. Test firings at known ranges were also conducted with the same weapons and ammunition.
data(shotgun.df)data(shotgun.df)
A data frame with 3 variables:
| [,1] | range | numeric | the range in feet of the firing |
| [,2] | sqrt.area | numeric | the square root of the area of the smallest rectangle that would enclose the pellet pattern |
| [,3] | model | factor | the model of shotgun used in the experiment |
J.M. Curran
Rowe, W.F. and Hanson, S.R. (1985) Range-of-fire estimates from regression analysis applied to the spreads of shotgun pellet patterns: Results of a blind study, Forensic Science International, 28(3-4): 239-250.
This data has been recorded the shape of the occipital squamous bone as narrow, equal, or greater for different races.
data(squamous.df)data(squamous.df)
S. M. Weinberg, D. A. Putz, M. P. Mooney, and M. I. Siegel. Evaluation of non-metric variation in the crania of black and white perinates. Forensic Science International, 151(2-3):177-185, July 2005.
Stangle more than one file at once. This is a helper function to Stangle all the chapters in Data Analysis for Forensic Scientists (DAFS) at once. I have put it into the library for completeness and in the hope that someone else might find it useful.
StangleBook(idx = 0:6, fileList = paste(paste("Chapter", idx, "/", sep = ""), paste("ch", idx, ".rnw", sep = ""), sep = ""))StangleBook(idx = 0:6, fileList = paste(paste("Chapter", idx, "/", sep = ""), paste("ch", idx, ".rnw", sep = ""), sep = ""))
idx |
There seven chapters in Data Analysis for Forensic Scientists. Corresponding to each chapter is a folder named ChapterI where I is a number from 0 to 6, and an Sweave file named chI.rnw. This parameter lets the user select which subset of files need to be run through Stangle |
fileList |
This parameter may be altered to suit the structure of your book. By default it is set to create a list of files that have the same name and directory structure as DAFS. The function iterates over a set of file names specified by this parameter. |
No values are returned
James Curran
Stangle
Sweave more than one file at once. This is a helper function to Sweave all the chapters in Data Analysis for Forensic Scientists (DAFS) at once. I have put it into the library for completeness and in the hope that someone else might find it useful.
SweaveBook(idx = 0:6, fileList = paste(paste("Chapter", idx, "/", sep = ""), paste("ch", idx, ".rnw", sep = ""), sep = ""))SweaveBook(idx = 0:6, fileList = paste(paste("Chapter", idx, "/", sep = ""), paste("ch", idx, ".rnw", sep = ""), sep = ""))
idx |
There seven chapters in Data Analysis for Forensic Scientists. Corresponding to each chapter is a folder named ChapterI where I is a number from 0 to 6, and an Sweave file named chI.rnw. This parameter lets the user select which subset of files need to be run through Sweave |
fileList |
This parameter may be altered to suit the structure of your book. By default it is set to create a list of files that have the same name and directory structure as DAFS. The function iterates over a set of file names specified by this parameter. |
No values are returned
James Curran
Sweave
This data has tryptase concentrations, which was measured in blood from the femoral vein in 60 deaths: 39 control cases who died rapidly (within minutes) from natural causes (sudden cardiac death and acute aortic dissection), 16 with death caused by prolonged asphyxia (traumatic compression of the chest and suffocation due to body position or smothering), and five anaphylactic deaths. In 44 of these cases, tryptase was measured in both heart (Tryp.cor) and femoral blood (Tryp.fem).
data(tryptase.df)data(tryptase.df)
E. Edston, O. Eriksson, M. V. Hage. Mast cell tryptase in postmortem serum - reference values and confounders. International Journal of Legal Medicine, 121(4):275-280, May 2006
This data is about calibration between gun powder loading and speed.
data(velocity.df)data(velocity.df)
S. C. K. Wong. The effects of projectile properties on glass backscatter: A statistical analysis. Master's thesis, Department of Chemistry, University of Auckland, 2007. Forensic Science.
This data has the carbohydrate-deficient transferrin concentration in vitreous humour (VH-CDT) in 21 alcoholics and 7 non-alcoholics.
data(vhcdt.df)data(vhcdt.df)
The data consist of a data frame with 28 observations on 7 variables.
| age alc vhcdt1 vhcdt2 vhtf td th [,1] | age | integer | age in years |
| [,2] | alc | factor | levels (Y, N) |
| [,3] | vhcdt1 | double | vitreous humour carbohydrate deficient transferrin concentration (micrograms per liter) - first assay run |
| [,4] | vhcdt2 | double | vitreous humour carbohydrate deficient transferrin concentration (micrograms per liter) second assay run |
| [,5] | vhtf | double | vitreous humour transferrin (micrograms per liter) |
| [,6] | td | integer | time interval to autopsy since found dead |
| [,7] | td | integer | time interval to autopsy since found alive |
vhcdt1 had a detection limit of 5 micrograms per liter. Observations below this level were coded as 2.5. Similarly in the second assay a detection limit of 2.5 micrograms per liter was used. Observations below this threshold were coded as 1.125.
Berkowicz, A. et al.
Berkowicz, A., Wallerstedt, S., Wall, K. and Denison, H., Analysis of carbohydrate-deficient transferrin (CDT) in vitreous humour as a forensic tool for detection of alcohol misuse, Forensic Science International 137:(2003) 119-124.
This data comes from a glass fragments experiment, count the number of glass fragments on the ground that were recovered after a window pane was shot with a handgun. The projectile velocity was controlled by altering the amount of gunpowder added to each bullet. The hardness (as measured on the Rockwell scale of hardness) of each projectile was altered by changing the amount of antimony (Sb) added to the projectile lead during casting. The profile of the projectile was changed by using a round-nose (RN) or wad-cutter (WC) mold. A full factorial design was used to allocate combinations of the factors (velocity, hardness, and profile) to the experimental units (shots). There were four velocity levels, three hardness levels, and two profile levels.
data(wong.df)data(wong.df)
S. C. K. Wong. The effects of projectile properties on glass backscatter: A statistical analysis. Master's thesis, Department of Chemistry, University of Auckland, 2007. Forensic Science.