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)
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)
Returns an object of class
adk. This object has the following fields:
the expression used to call this function
the original data used to compute the ADK
a vector of the groups used in the computation
the value of alpha specified
the total number of observations
the number of groups
the computed standard deviation of the test statistic
the value of the Anderson--Darling k-Sample test statistic
the computed p-value
a boolean value indicating whether the null hypothesis that all samples come from the same distribution is rejected
the original results returned from ad.test
This function is a wrapper for the ad.test function from
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
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.
#> #>#>#> #>#>#> #>carbon.fabric %>% filter(test == "WT") %>% filter(condition == "RTD") %>% ad_ksample(strength, batch)#> #> 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 )