This function performs an Anderson--Darling k-sample test. This is used to determine if several samples (groups) share a common (unspecified) distribution.

ad_ksample(data = NULL, x, groups, alpha = 0.025)

## Arguments

data a data.frame the variable in the data.frame on which to perform the Anderson--Darling k-Sample test (usually strength) a variable in the data.frame that defines the groups the significance level (default 0.025)

## Value

Returns an object of class adk. This object has the following fields:

call

the expression used to call this function

data

the original data used to compute the ADK

groups

a vector of the groups used in the computation

alpha

the value of alpha specified

n

the total number of observations

k

the number of groups

sigma

the computed standard deviation of the test statistic

ad

the value of the Anderson--Darling k-Sample test statistic

p

the computed p-value

reject_same_dist

a boolean value indicating whether the null hypothesis that all samples come from the same distribution is rejected

raw

the original results returned from ad.test

## Details

This function is a wrapper for the ad.test function from the package kSamples. The method "exact" is specified in the call to ad.test. Refer to that package's documentation for details.

There is a minor difference in the formulation of the Anderson--Darling k-Sample test in CMH-17-1G, compared with that in the Scholz and Stephens (1987). This difference affects the test statistic and the critical value in the same proportion, and therefore the conclusion of the test is unaffected. When comparing the test statistic generated by this function to that generated by software that uses the CMH-17-1G formulation (such as ASAP, CMH17-STATS, etc.), the test statistic reported by this function will be greater by a factor of $$(k - 1)$$, with a corresponding change in the critical value.

For more information about the difference between this function and the formulation in CMH-17-1G, see the vignette on the subject, which can be accessed by running vignette("adktest")

## References

F. W. Scholz and M. Stephens, “K-Sample Anderson--Darling Tests,” Journal of the American Statistical Association, vol. 82, no. 399. pp. 918–924, Sep-1987.

“Composite Materials Handbook, Volume 1. Polymer Matrix Composites Guideline for Characterization of Structural Materials,” SAE International, CMH-17-1G, Mar. 2012.

## Examples

library(dplyr)#>
#> Attaching package: ‘dplyr’#> The following objects are masked from ‘package:stats’:
#>
#>     filter, lag#> The following objects are masked from ‘package:base’:
#>
#>     intersect, setdiff, setequal, union
carbon.fabric %>%
filter(test == "WT") %>%
filter(condition == "RTD") %>%
#> Call:
#> ad_ksample(data = ., x = strength, groups = batch)
#>
#> N = 18           k = 3
#> ADK = 0.912      p-value = 0.95989
#> Conclusion: Samples come from the same distribution ( alpha = 0.025 )
#> ##
## Call:
## ad_ksample(data = ., x = strength, groups = batch)
##
## N = 18          k = 3
## ADK = 0.912     p-value = 0.95989
## Conclusion: Samples come from the same distribution ( alpha = 0.025 )