2
$\begingroup$

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?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

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
$\endgroup$
3
  • $\begingroup$ The link to the qualityTools package no longer seems to work, perhaps CRAN.R-project.org/package=qualityTools is better? $\endgroup$
    – mdewey
    Aug 28, 2018 at 12:11
  • $\begingroup$ @mdewey The link is working for me. $\endgroup$
    – ABCD
    Aug 28, 2018 at 12:24
  • $\begingroup$ The github one works here but not the one to the Czech domain. $\endgroup$
    – mdewey
    Aug 28, 2018 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.