compareGroups: Compare bullet hole groups

View source: R/compareGroups.R

compareGroupsR Documentation

Compare bullet hole groups

Description

Numerically and graphically compare accuracy, precision, and distribution shape of up to 15 groups of bullet holes.

Usage

compareGroups(DF, plots = TRUE, xyTopLeft = TRUE, center = FALSE,
              ABalt = c('two.sided', 'less', 'greater'),
              Walt = c('two.sided', 'less', 'greater'),
              CEPtype = 'CorrNormal', CEPlevel = 0.5, CIlevel = 0.95,
              dstTarget, conversion)

Arguments

DF

a data frame containing (at least) these variables: series (a factor), and either point.x, point.y or x, y defining the bullet holes. Variables distance (distance to target), aim.x, aim.y (point of aim) are useful - if they are missing, a warning is given and a default assumed.

plots

logical: show diagrams?

xyTopLeft

logical: is the origin of the absolute coordinate system in the top-left corner? See details.

center

logical: center groups to mean (0,0) first to compare only with respect to precision?

ABalt

a character string indicating the hypothesis for the Ansari-Bradley-Test for equal variances. Only used when exactly 2 groups are compared.

Walt

a character string indicating the hypothesis for the Wilcoxon-Rank-Sum-Test for equality of average distance to group center (equivalent to the Mann-Whitney-U-Test). Only used when exactly 2 groups are compared.

CEPtype

string indicating which CEP estimate to report from getCEP.

CEPlevel

a numerical value giving the coverage of the confidence ellipse and CEP.

CIlevel

a numerical value giving the level for the confidence intervals (for standard deviations and Rayleigh sigma, MR).

dstTarget

a numerical value giving the distance to the target - used in MOA calculation. Acts as override if variable distance is already included in DF. 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 DF. Example 'm2cm'. See getMOA.

Details

By default, OnTarget PC/TDS' 'Export Point Data' places the origin of the absolute coordinate system in the top-left corner. In OnTarget TDS, this setting can be changed by checking the box 'Tools -> Options -> Options tab -> Data Export -> Invert Y-Axis on Export'. In that case, use xyTopLeft=FALSE. If groups appear to be upside-down, xyTopLeft is the setting to change.

OnTarget PC/TDS' Group variable identifies groups just within one file, whereas factor series is taken to number groups also across different original files. If your data was read with readDataOT1, readDataOT2 or readDataMisc, series is added automatically. For data from just one file, you can otherwise copy variable group to series in a data frame called shots with shots$series <- shots$group.
If the data is missing information about the point of aim, (0,0) is assumed. If distance to target is missing, 100 is assumed.

In addition to the numerical results listed below, this function produces the following diagrams:

  • a scatterplot showing all groups as well as their respective center and confidence ellipse

  • a scatterplot showing all groups as well as their respective (minimum) bounding box and maximum group spread

  • a scatterplot showing all groups as well as their respective minimum enclosing circle and circle with average distance to center

  • a boxplot for the distances to group center per group

  • a stripchart showing the distances to group center per group together with the estimated Rayleigh mean radius and its confidence interval

If package shiny is installed, an interactive web app for this functionality can be run with runGUI("analyze"). If package coin is installed, permutation tests are run instead of asymptotic tests (Fligner, Ansari-Bradley, Wilcoxon, Kruskal).

Value

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

ctr

group center offset from the respective point of aim.

distPOA

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

MANOVA

MANOVA result from testing equality of group center offset from the respective point of aim (test statistic is Wilk's lambda).

corXY

group correlation matrices for the (x,y)-coordinates.

sdXY

list with group standard deviations of the x- and y-coordinates (in original measurement units, MOA, SMOA, milliradian).

sdXYci

list with group parametric (chi^2) confidence intervals for the standard deviations of x- and y coordinates (in original measurement units, MOA, SMOA, milliradian).

meanDistToCtr

average distances from points to their respective group center (in original measurement units, MOA, SMOA, milliradian).

maxPairDist

maximum pairwise distance between points for each group (center-to-center, = maximum spread, in original measurement units, MOA, SMOA, milliradian).

bbFoM

minimum-area bounding box figure of merit (average side length) for each group (in original measurement units, MOA, SMOA, milliradian).

bbDiag

minimum-area bounding box diagonal length for each group (in original measurement units, MOA, SMOA, milliradian).

minCircleRad

radius of the minimum enclosing circle for each group (in original measurement units, MOA, SMOA, milliradian).

sigma

estimated Rayleigh parameter sigma (precision) for each group (in original measurement units, MOA, SMOA, milliradian).

MR

estimated Rayleigh mean radius for each group (in original measurement units, MOA, SMOA, milliradian).

sigmaMRci

parametric (chi^2) confidence intervals for Rayleigh sigma and MR (in original measurement units, MOA, SMOA, milliradian).

CEP

Estimate for the circular error probable (CEP) in each group (in original measurement units, MOA, SMOA, milliradian).

AnsariX

Ansari-Bradley-Test result from testing equality of group variances for x-coordinates. When two groups are compared.

AnsariY

Ansari-Bradley-Test result from testing equality of group variances for y-coordinates. When two groups are compared.

Wilcoxon

Wilcoxon-Rank-Sum-Test result from testing equality of average point distances to their respective group center. When two groups are compared.

FlignerX

Fligner-Killeen-Test result from testing equality of group variances for x-coordinates. When more than two groups are compared.

FlignerY

Fligner-Killeen-Test result from testing equality of group variances for y-coordinates. When more than two groups are compared.

Kruskal

Kruskal-Wallis-Test result from testing equality of average point distances to their respective group center. When more than two groups are compared.

See Also

analyzeGroup, getDistToCtr, getMaxPairDist, getMinBBox, getMinCircle, getCEP, getMOA, getRayParam, drawEllipse, anova.mlm, ansari.test, fligner.test, wilcox.test, kruskal.test, ansari_test, fligner_test, wilcox_test, kruskal_test

Examples

cmp <- compareGroups(DF300BLKhl, dstTarget=100, conversion='yd2in')
names(cmp)
cmp$ctr
cmp$meanDistToCtr
cmp$CEP
cmp$Kruskal

dwoll/shotGroups documentation built on Feb. 16, 2024, 2:21 p.m.