Learn R Programming

shotGroups (version 0.6.1)

compareGroups: 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,
              ABalt = c('two.sided', 'less', 'greater'),
              Walt = c('two.sided', 'less', 'greater'),
              CEPtype = 'CorrNormal', CEPlevel = 0.5, CIlevel = 0.95, conversion = 'm2cm')

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. Variable
plots
logical: show diagrams?
xyTopLeft
logical: is the origin of the absolute coordinate system in the top-left corner? See details.
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).
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. See getMOA.

Value

  • A list with the results from numerical comparisons and statistical tests.
  • ctrgroup center offset from the respective point of aim.
  • distPOAdistances from group centers to point of aim (in original measurement units, MOA, SMOA, milliradian).
  • MANOVAMANOVA result from testing equality of group center offset from the respective point of aim (test statistic is Wilk's lambda).
  • corXYgroup correlation matrices for the (x,y)-coordinates.
  • sdXYlist with group standard deviations of the x- and y-coordinates (in original measurement units, MOA, SMOA, milliradian).
  • sdXYcilist with group parametric (chi^2) confidence intervals for the standard deviations of x- and y coordinates (in original measurement units, MOA, SMOA, milliradian).
  • meanDistToCtraverage distances from points to their respective group center (in original measurement units, MOA, SMOA, milliradian).
  • maxPairDistmaximum pairwise distance between points for each group (center-to-center, = maximum spread, in original measurement units, MOA, SMOA, milliradian).
  • bbFoMminimum-area bounding box figure of merit (average side length) for each group (in original measurement units, MOA, SMOA, milliradian).
  • bbDiagminimum-area bounding box diagonal length for each group (in original measurement units, MOA, SMOA, milliradian).
  • minCircleRadradius of the minimum enclosing circle for each group (in original measurement units, MOA, SMOA, milliradian).
  • sigmaestimated Rayleigh parameter sigma (precision) for each group (in original measurement units, MOA, SMOA, milliradian).
  • MRestimated Rayleigh mean radius for each group (in original measurement units, MOA, SMOA, milliradian).
  • sigmaMRciparametric (chi^2) confidence intervals for Rayleigh sigma and MR (in original measurement units, MOA, SMOA, milliradian).
  • CEPEstimate for the circular error probable (CEP) in each group (in original measurement units, MOA, SMOA, milliradian).
  • AnsariXAnsari-Bradley-Test result from testing equality of group variances for x-coordinates. When two groups are compared.
  • AnsariYAnsari-Bradley-Test result from testing equality of group variances for y-coordinates. When two groups are compared.
  • WilcoxonWilcoxon-Rank-Sum-Test result from testing equality of average point distances to their respective group center. When two groups are compared.
  • FlignerXFligner-Killeen-Test result from testing equality of group variances for x-coordinates. When more than two groups are compared.
  • FlignerYFligner-Killeen-Test result from testing equality of group variances for y-coordinates. When more than two groups are compared.
  • KruskalKruskal-Wallis-Test result from testing equality of average point distances to their respective group center. When more than two groups are compared.

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 Groups 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

See Also

analyzeGroup, getDistToCtr, getMaxPairDist, getMinBBox, getMinCircle, getCEP, getMOA, getRayParam, drawEllipse, anova.mlm, ansari_test, fligner_test, wilcox_test, kruskal_test

Examples

Run this code
cmp <- compareGroups(DF300BLKhl, conversion='yd2in')
names(cmp)
cmp$ctr
cmp$meanDistToCtr
cmp$CEP
cmp$Kruskal

Run the code above in your browser using DataLab