Một bài kiểm tra & nbsp; Anderson-Darling là một bài kiểm tra phù hợp để đo lường mức độ dữ liệu của bạn phù hợp với một phân phối được chỉ định.Anderson-Darling Test is a goodness of fit test that measures how well your data fit a specified distribution.Anderson-Darling Test is a goodness of fit test that measures how well your data fit a specified distribution. Thử nghiệm này được sử dụng phổ biến nhất để xác định liệu dữ liệu của bạn có theo A & NBSP; Phân phối bình thường hay không. Kiểu thử nghiệm này rất hữu ích để kiểm tra tính quy tắc, đây là một giả định phổ biến được sử dụng trong nhiều thử nghiệm thống kê bao gồm hồi quy, ANOVA, Tests và nhiều thử nghiệm khác. Để thực hiện một bài kiểm tra Anderson-Darling trong Python, chúng ta có thể sử dụng hàm Anderson () từ thư viện scipy.stats, sử dụng cú pháp sau: Anderson (X, Dist = Tiết Norm,) where: Ví dụ, ở đây, cách thực hiện thử nghiệm Anderson-Darling trên mẫu gồm 50 biến ngẫu nhiên được phân phối bình thường: Thống kê thử nghiệm là 0,150. Chúng ta có thể so sánh giá trị này với từng giá trị tới hạn tương ứng với từng mức ý nghĩa để xem liệu kết quả kiểm tra có đáng kể hay không. Ví dụ:0.150. We can compare this value to each critical value that corresponds to each significance level to see if the test results are significant. For example:0.150. We can compare this value to each critical value that corresponds to each significance level to see if the test results are significant. For example: Và như thế. Chúng ta có thể thấy rằng các kết quả kiểm tra không đáng kể ở bất kỳ mức ý nghĩa nào, điều đó có nghĩa là chúng ta sẽ không từ chối giả thuyết khống của bài kiểm tra. Do đó, chúng tôi không có đủ bằng chứng để nói rằng dữ liệu mẫu thường không được phân phối. Kết quả này không đáng ngạc nhiên khi xem xét chúng tôi đã sử dụng hàm np.rand.nmal () để tạo mẫu gồm 50 giá trị phân phối bình thường.np.rand.normal() function to generate a sample of 50 normally distributed values.np.rand.normal() function to generate a sample of 50 normally distributed values. Thay vào đó hãy xem xét nếu chúng tôi thực hiện bài kiểm tra Anderson-Darling trên mẫu gồm 50 số nguyên ngẫu nhiên trong khoảng từ 0 đến 10: import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ])) Thống kê thử nghiệm là 1.1926. Chúng ta có thể so sánh giá trị này với từng giá trị tới hạn tương ứng với từng mức ý nghĩa để xem liệu kết quả kiểm tra có đáng kể hay không. Ví dụ:1.1926. We can compare this value to each critical value that corresponds to each significance level to see if the test results are significant. For example:1.1926. We can compare this value to each critical value that corresponds to each significance level to see if the test results are significant. For example:
Và như thế. Chúng ta có thể thấy rằng các kết quả kiểm tra không đáng kể ở bất kỳ mức ý nghĩa nào, điều đó có nghĩa là chúng ta sẽ không từ chối giả thuyết khống của bài kiểm tra. Do đó, chúng tôi không có đủ bằng chứng để nói rằng dữ liệu mẫu thường không được phân phối. Kết quả này không đáng ngạc nhiên khi xem xét chúng tôi đã sử dụng hàm np.rand.nmal () để tạo mẫu gồm 50 giá trị phân phối bình thường.np.rand.normal() function to generate a sample of 50 normally distributed values.np.rand.randint() function to generate a sample of 50 random integers between 0 and 10, which is unlikely to follow a normal distribution. Thay vào đó hãy xem xét nếu chúng tôi thực hiện bài kiểm tra Anderson-Darling trên mẫu gồm 50 số nguyên ngẫu nhiên trong khoảng từ 0 đến 10: Thống kê thử nghiệm là 1.1926. Chúng ta có thể so sánh giá trị này với từng giá trị tới hạn tương ứng với từng mức ý nghĩa để xem liệu kết quả kiểm tra có đáng kể hay không. Ví dụ:1.1926. We can compare this value to each critical value that corresponds to each significance level to see if the test results are significant. For example: Giá trị tới hạn cho & nbsp; α = 0,01 là & nbsp; 1.021. Do thống kê thử nghiệm (1.1926) lớn hơn giá trị tới hạn này, kết quả có ý nghĩa ở mức ý nghĩa là 0,01.1.021. Because the test statistic (1.1926) is greater than this critical value, the results are significant at a significance level of 0.01. import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))30 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))0 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))32 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))33 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))34 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))1 Ví dụ 2: Bây giờ chúng ta hãy xem xét tiến hành thử nghiệm Anderson-Darling trên một mẫu gồm 100 số nguyên ngẫu nhiên trong khoảng từ 0 đến 20. import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))30 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))0 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))32 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))33 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))34 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))1 Its full name is Anderson-Darling Goodness of Fit Test (AD-Test) and it is used to measure the extent to which our data fits with the specified distribution. Mostly this test is used to find whether the data follows a normal distribution. 2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))30 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))0 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))32 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))33 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))34 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))1 Its full name is Anderson-Darling Goodness of Fit Test (AD-Test) and it is used to measure the extent to which our data fits with the specified distribution. Mostly this test is used to find whether the data follows a normal distribution. Cú pháp để cài đặt thư viện Scipy và Numpy: import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))4 Scipy là một thư viện Python được sử dụng để tính toán khoa học. Nó cung cấp chức năng Anderson () để tiến hành kiểm tra Anderson-Darling. & NBSP; Chức năng của Anderson (): Syntax:
Parameters:
Ví dụ 1: Python3import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))4 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))7 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))0 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))1 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))4 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))1 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))8 Output: Đầu ra Thống kê thử nghiệm xuất hiện là 0,18. Giá trị này có thể được so sánh với từng giá trị tới hạn tương ứng với từng mức ý nghĩa để kiểm tra xem kết quả thử nghiệm có đáng kể hay không. & NBSP; Ví dụ:
Vì kết quả kiểm tra không có ý nghĩa ở bất kỳ mức ý nghĩa nào ngụ ý rằng chúng ta không thể bác bỏ giả thuyết khống của thử nghiệm này. Do đó, chúng tôi không có bằng chứng đầy đủ để tuyên bố rằng dữ liệu đã cho thường không được phân phối. Ví dụ 2: Bây giờ chúng ta hãy xem xét tiến hành thử nghiệm Anderson-Darling trên một mẫu gồm 100 số nguyên ngẫu nhiên trong khoảng từ 0 đến 20. Python3import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))2 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))4 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))3 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))6 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))7 import numpy as np #create data np.random.seed(0) data = np.random.randint(0, 10, size=50) #perform Anderson-Darling Test from scipy.stats import anderson anderson(data) AndersonResult(statistic=1.1926463985076836, critical_values=array([0.538, 0.613, 0.736, 0.858, 1.021]), significance_level=array([15. , 10. , 5. , 2.5, 1. ]))7 Output: Đầu ra Thống kê thử nghiệm xuất hiện là 2.073. Giá trị này có thể được so sánh với từng giá trị tới hạn tương ứng với từng mức ý nghĩa để kiểm tra xem kết quả thử nghiệm có đáng kể hay không. Ví dụ:
Vì kết quả kiểm tra không có ý nghĩa ở bất kỳ mức ý nghĩa nào ngụ ý rằng chúng ta không thể bác bỏ giả thuyết khống của thử nghiệm này. Do đó, chúng tôi không có bằng chứng đầy đủ để tuyên bố rằng dữ liệu đã cho thường không được phân phối. |