Learn R Programming

shotGroups (version 0.2-2)

groupShape: Shape analysis for a single group of bullet holes

Description

Assesses shape of a single group of bullet holes: Outlier analysis as well as numerical and graphical normality checks for a set of (x,y)-coordinates.

Usage

groupShape(xy, plots = TRUE, bandW = 0.5)

Arguments

xy
a numerical (n x 2)-matrix with the (x,y)-coordinates of n points (1 row of coordinates per point).
plots
a logical value indicating whether diagrams should be shown.
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.

Details

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

See Also

qqnorm, smoothScatter, hist, kernel, covMcd, shapiro.test, mvnorm.etest, chisq.plot, aq.plot

Examples

Run this code
xy  <- matrix(round(rnorm(200, 0, 5), 2), ncol=2)
res <- groupShape(xy, bandW=1.6)
names(res)
res$corXY
res$Outliers
res$multNorm

Run the code above in your browser using DataLab