Learn R Programming

shotGroups (version 0.2-2)

analyzeGroup: Analysis for a single group of bullet holes

Description

Performs a comprehensive numerical and graphical analysis of a single group of bullet holes.

Usage

analyzeGroup(DF, xyTopLeft = TRUE, conversion = 'm2cm', bandW = 0.5)

Arguments

DF
a data frame containing (at least) these variables: Distance, Aim.X, Aim.Y defining point of aim, Point.X, and Point.Y defining the bullet holes.
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.
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. See getMOA.
bandW
for argument bandwith of smoothScatter.

Value

  • A list with the results from the numerical analyses and statistical tests.
  • corXYcorrelation matrix of (x,y)-coordinates.
  • corXYrobrobust estimate of correlation matrix of (x,y)-coordinates.
  • Outliersa vector of row indices for observations identified as outliers.
  • ShapiroXShapiro-Wilk-Test result for normality of x-coordinates.
  • ShapiroYShapiro-Wilk-Test result for normality of y-coordinates.
  • multNormE-statistic-Test result for multivariate normality of (x,y)-coordinates.
  • sdXYstandard deviations of x- and y coordinates (in original measurement units and MOA).
  • CIsdXYparametric 95%-confidence interval for the standard deviations of x- and y coordinates (in original measurement units).
  • sdXYrobrobust standard deviations of x- and y-coordinates (in original measurement units and MOA).
  • covXYcovariance matrix of (x,y)-coordinates.
  • covXYrobrobust estimate of covariance matrix of (x,y)-coordinates.
  • meanDistToCtraverage distance from points to their center (in original measurement units and MOA).
  • maxPairDistmaximum pairwise distance between points (center-to-center, a.k.a. maximum spread, in original measurement units and MOA).
  • groupRectwidth and height of minimum bounding box (in original measurement units and MOA).
  • minCircleRadradius for the minimum enclosing circle (in original measurement units and MOA).
  • confElllength of semi-major and semi-minor axis of the 50%-confidence ellipse (in original measurement units and MOA).
  • confEllRoblength of semi-major and semi-minor axis of the 50%-confidence ellipse based on a robust estimate for the covariance matrix (in original measurement units and MOA).
  • confEllShapeaspect ratio and flattening of the confidence ellipse.
  • confEllShapeRobaspect ratio and flattening of the confidence ellipse based on a robust estimate for the covariance matrix.
  • CEPrandmodified RAND R-234 estimate for the circular error probable (CEP, in original measurement units and MOA).
  • ctr(x,y)-offset of group center relative to point of aim.
  • ctrRobrobust estimate of group center offset relative to point of aim.
  • distPOAdistance from group center to point of aim (in original measurement units and MOA).
  • distPOArobdistance from robust estimate of group center to point of aim (in original measurement units and MOA).
  • HotellingHotelling's T^2-Test result from testing if group center equals point of aim.
  • CItX95% t-confidence interval for x-coordinates.
  • CItY95% t-confidence interval for y-coordinates.
  • CIbootX95% bootstrap-confidence intervals for x-coordinates (percentile and BCa, 1499 replicates).
  • CIbootY95% bootstrap-confidence intervals for y-coordinates (percentile and BCa, 1499 replicates).

Details

Robust estimates for the group center and the covariance matrix of (x,y)-coordinates are from covMcd using the MCD algorithm. This function is a wrapper for groupShape, groupLocation, and groupSpread. In addition to the numerical results listed below, this function produces the following diagrams:
  • a combined plot for multivariate outlier identification as produced byaq.plot
  • a scatterplot of the (x,y)-coordinates together with group center, circle with average distance to center, 50\%-confidence ellipse - the latter also based on a robust estimate for the covariance matrix
  • a scatterplot of the (x,y)-coordinates together with the minimum bounding box, minimum enclosing circle, and maximum group spread
  • a chi-square Q-Q-plot for eyeballing multivariate normality as produced bychisq.plot, including a reference line with intercept 0 and slope 1
  • a heatmap of a 2D-kernel density estimate for the (x,y)-coordinates as produced bysmoothScattertogether with group center and error ellipse based on a robust estimate for the covariance matrix
  • a Q-Q-plot for x-coordinates for eyeballing normality
  • a Q-Q-plot for y-coordinates for eyeballing normality
  • a histogram for x-coordinates including a fitted normal distribution as well as a nonparametric kernel density estimate
  • a histogram for y-coordinates including a fitted normal distribution as well as a nonparametric kernel density estimate
  • a histogram for distances to group center including a nonparametric kernel density estimate

See Also

groupShape, groupLocation, groupSpread, compareGroups, combineData, getDistToCtr, getMaxPairDist, getMinBBox, getMinCircle, getConfEll, getCEP, getMOA, smoothScatter, aq.plot, chisq.plot, qqnorm, hist, kernel, shapiro.test, mvnorm.etest, anova.mlm, boot, boot.ci, covMcd

Examples

Run this code
data(DFinch)

# select combined data from only first 4 series
DF  <- subset(DFinch, Series %in% 1:4)
res <- analyzeGroup(DF, conversion='yd2in')
names(res)
res$multNorm
res$corXY
res$ctrRob
res$CIbootX
res$CIbootY

Run the code above in your browser using DataLab