Numerically and graphically compare accuracy, precision, and distribution shape of up to 15 groups of bullet holes.
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)
A list with the results from numerical comparisons and statistical tests.
group center offset from the respective point of aim.
distances from group centers to point of aim (in original measurement units, MOA, SMOA, milliradian).
MANOVA result from testing equality of group center offset from the respective point of aim (test statistic is Wilk's lambda).
group correlation matrices for the (x,y)-coordinates.
list with group standard deviations of the x- and y-coordinates (in original measurement units, MOA, SMOA, milliradian).
list with group parametric (chi^2) confidence intervals for the standard deviations of x- and y coordinates (in original measurement units, MOA, SMOA, milliradian).
average distances from points to their respective group center (in original measurement units, MOA, SMOA, milliradian).
maximum pairwise distance between points for each group (center-to-center, = maximum spread, in original measurement units, MOA, SMOA, milliradian).
minimum-area bounding box figure of merit (average side length) for each group (in original measurement units, MOA, SMOA, milliradian).
minimum-area bounding box diagonal length for each group (in original measurement units, MOA, SMOA, milliradian).
radius of the minimum enclosing circle for each group (in original measurement units, MOA, SMOA, milliradian).
estimated Rayleigh parameter sigma (precision) for each group (in original measurement units, MOA, SMOA, milliradian).
estimated Rayleigh mean radius for each group (in original measurement units, MOA, SMOA, milliradian).
parametric (chi^2) confidence intervals for Rayleigh sigma and MR (in original measurement units, MOA, SMOA, milliradian).
Estimate for the circular error probable (CEP) in each group (in original measurement units, MOA, SMOA, milliradian).
Ansari-Bradley-Test result from testing equality of group variances for x-coordinates. When two groups are compared.
Ansari-Bradley-Test result from testing equality of group variances for y-coordinates. When two groups are compared.
Wilcoxon-Rank-Sum-Test result from testing equality of average point distances to their respective group center. When two groups are compared.
Fligner-Killeen-Test result from testing equality of group variances for x-coordinates. When more than two groups are compared.
Fligner-Killeen-Test result from testing equality of group variances for y-coordinates. When more than two groups are compared.
Kruskal-Wallis-Test result from testing equality of average point distances to their respective group center. When more than two groups are compared.
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.
logical: show diagrams?
logical: is the origin of the absolute coordinate system in the top-left corner? See details.
logical: center groups to mean (0,0) first to compare only with respect to precision?
a character string indicating the hypothesis for the Ansari-Bradley-Test for equal variances. Only used when exactly 2 groups are compared.
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.
string indicating which CEP estimate to report from getCEP
.
a numerical value giving the coverage of the confidence ellipse and CEP.
a numerical value giving the level for the confidence intervals (for standard deviations and Rayleigh sigma, MR).
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
.
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
.
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")
.
analyzeGroup
,
getDistToCtr
,
getMaxPairDist
,
getMinBBox
,
getMinCircle
,
getCEP
,
getMOA
,
getRayParam
,
drawEllipse
,
anova.mlm
,
ansari_test
,
fligner_test
,
wilcox_test
,
kruskal_test
cmp <- compareGroups(DF300BLKhl, dstTarget=100, conversion='yd2in')
names(cmp)
cmp$ctr
cmp$meanDistToCtr
cmp$CEP
cmp$Kruskal
Run the code above in your browser using DataLab