groupLocation {shotGroups}R Documentation

Accuracy: Location measures for a single group of bullet holes

Description

Calculates location measures for a single group of bullet holes.

Usage

groupLocation(xy, level = 0.95, plots = TRUE, bootCI = 'none',
              dstTarget, conversion)

## S3 method for class 'data.frame'
groupLocation(xy, level = 0.95, plots = TRUE, bootCI = 'none',
              dstTarget, conversion)

## Default S3 method:
groupLocation(xy, level = 0.95, plots = TRUE, bootCI = 'none',
              dstTarget, conversion)

Arguments

xy

either a numerical (n x 2)-matrix with the (x,y)-coordinates of n points (1 row of coordinates per point), or a data frame with either the variables x, y or point.x, point.y as well as aim.x, aim.y giving the point of aim. If missing, point of aim is assumed to be in (0,0).

level

a numerical value giving the level for the confidence intervals for the center (x,y)-coordinates.

plots

logical: show a 2D-scatterplot?

bootCI

a character vector to select which bootstrap confidence interval type to report. Possible types are 'none' (no bootstrap CI), 'norm', 'basic', 'perc', 'bca'. See boot.ci.

dstTarget

a numerical value giving the distance to the target - used in MOA calculation. Acts as override if variable distance is already included in xy. See getMOA.

conversion

how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. Acts as override if variables dist.unit and point.unit are already included in xy. Example 'm2cm'. See getMOA.

Details

The number of replicates for the reported bootstrap confidence intervals is at least 1499. If the BCa interval is reported, it is at least the number of points.

If package shiny is installed, an interactive web app for this functionality can be run with runGUI("analyze").

Value

A list with the results from the numerical analyses and statistical tests.

ctr

(x,y)-offset of group center relative to point of aim.

ctrXci

parametric (t) and bootstrap confidence intervals for center x-coordinate.

ctrYci

parametric (t) and bootstrap confidence intervals for center y-coordinate.

ctrRob

robust estimate of group center offset relative to point of aim (MCD algorithm).

distPOA

distance from group center to point of aim (in original measurement units, MOA, SMOA, milliradian).

distPOArob

distance from robust estimate of group center to point of aim (in original measurement units, MOA, SMOA, milliradian).

Hotelling

Hotelling's T^2-Test result from testing if group center equals point of aim.

See Also

getMOA, covMcd, anova.mlm, boot, boot.ci

Examples

# coordinates given by a suitable data frame
res <- groupLocation(DFsavage, dstTarget=100, conversion='m2mm',
                     level=0.95, plots=2, bootCI='basic')
names(res)
res$ctr
res$distPOA
res$ctrXci
res$ctrYci

# coordinates given by a matrix
## Not run: 
# assume data from pistol shooting at 25m with 9mm ammo
# metric units
xy <- matrix(round(rnorm(100, 0, 5), 2), ncol=2)
groupLocation(xy, dstTarget=25, conversion='m2cm', plots=2)

## End(Not run)

[Package shotGroups version 0.8.2 Index]