Learn R Programming

shotGroups (version 0.3)

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'),
              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
a logical value indicating whether diagrams should be shown.
xyTopLeft
a logical value indicating whether the origin of the absolute coordinate system is in the top-left corner. This is the default for data exported by OnTarget PC/TDS.
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.
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 centers relative to their respective point of aim.
  • distPOAdistances from group centers to point of aim (in original measurement units and MOA).
  • MANOVAMANOVA result from testing equality of group centers relative to their respective point of aim (test statistic is Wilk's lambda).
  • corXYgroup correlation matrices for the (x,y)-coordinates.
  • sdXYgroup standard deviations for the x- and y-coordinates (in original measurement units).
  • sdXYmoagroup standard deviations for the x- and y-coordinates (in MOA).
  • sdXYcigroup parametric (chi^2) 95%-confidence intervals for the standard deviations of x- and y coordinates (in original measurement units).
  • sdXYciMOAgroup parametric (chi^2) 95%-confidence intervals for the standard deviations of x- and y coordinates (in MOA).
  • meanDistToCtraverage distances from points to their respective group center (in original measurement units and MOA).
  • maxPairDistmaximum pairwise distance between points for each group (center-to-center, a.k.a. maximum spread, in original measurement units and MOA).
  • bbFoMminimum-area bounding box figure of merit (average side length) for each group (in original measurement units and MOA).
  • bbDiagminimum-area bounding box diagonal length for each group (in original measurement units and MOA).
  • minCircleRadradius of the minimum enclosing circle for each group (in original measurement units and MOA).
  • CEPrayRayleigh estimate for the 50% circular error probable (CEP) in each group (in original measurement units and MOA).
  • 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

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. Otherwise, you can just 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 50\%-confidence ellipse
  • a scatterplot showing all groups as well as their respective minimum bounding box, minimum enclosing circle, and maximum group spread
  • a scatterplot showing all groups as well as their respective minimum enclosing circle and circle with average distance to center

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
data(DFinch)

# select only first 2 series
DFsub <- subset(DFinch, Series %in% 2:3)
cmp   <- compareGroups(DFsub, conversion='yd2in')
names(cmp)
cmp$ctr
cmp$meanDistToCtr
cmp$CEPray
cmp$Wilcoxon

Run the code above in your browser using DataLab