Learn R Programming

shotGroups (version 0.2-2)

compareGroups: Compare bullet hole groups

Description

Numerically and graphically compares the distributions 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), Distance, Aim.X, Aim.Ydefining point of aim, Point.X, and Point.Y
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 the 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 (test statistic is Wilk's lambda).
  • corXYgroup correlation matrices for the (x,y)-coordinates.
  • sdXYgroup standard deviations for the x- and y-coordinates.
  • meanDistToCtraverage distances from points to their group centers (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).
  • groupWidthwidth of minimum bounding box for each group (in original measurement units and MOA).
  • groupHeightheight of minimum bounding box for each group (in original measurement units and MOA).
  • minCircleRadradius for the minimum enclosing circle for each group (in original measurement units and MOA).
  • CEPrandmodified RAND R-234 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 you only have one original file, you can just copy variable Groups to Series in your data frame. 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

combineData, analyzeGroup, getDistToCtr, getMaxPairDist, getMinBBox, getMinCircle, getCEP, getMOA, 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$CEPrand
cmp$Wilcoxon

Run the code above in your browser using DataLab