Solved – Can we compute P-value of Anderson Darling Test with AD statistic without using the tables given

anderson darling testp-value

I am fitting my experimental data with different distributions, I am computing Anderson Darling statistic for my data and theoretical distributions. I want to compute P value from Anderson Darling statistic without using the tables, How can I compute P value?

Best Answer

If you don't want to interpolate from pre-computed tables, you may want to do bootstrap-based simulation. Try adSim (https://cran.r-project.org/package=qualityTools)

Let's use normal distribution in our example. You'll need to change the string to something else if you don't like to test for normality.

Interpolation

adSim(x, "normal", NA)

$distribution
[1] "normal"

$parameter_estimation
 mean        sd 
32.450662  1.717755 

$Anderson_Darling
[1] 0.5028619

$p_value
[1] 0.1865325

The table critical values are 75%, 90%, 95%, 97.5% and 99% percentile (available in the source code https://github.com/cran/qualityTools/blob/master/R/adSim.R).

Boostrap simulation

adSim(x, "normal", 10000)

... simulating the Anderson-Darling distribution by 10000 bootstraps for normal distribution... 

$distribution
[1] "normal"

$parameter_estimation
     mean        sd 
32.450662  1.717755 

$Anderson_Darling
[1] 0.5028619

$p_value
[1] 0.1917