R Language for The Project Management Course — AUG University “part 7”
Welcome back! This is the 7th chapter of the series explaining the project management course for AUG students — The computer system engineering department.
Anderson-Darling Test(A²):
AD-Test is used to determine used to test if a sample of data came from a population with a specific distribution. Usually, used for normal distribution Therefore, we can use the same rules we use in the normal distribution.
The hypotheses for the AD-test are:
- H0: The data comes from a specified distribution.
- H1: The data does not come from a specified distribution.
Perform AD by Hand:
- Using this formula, calculate the AD Statistic:
Note: n is the sample size, F(x) is the CDF function, i is the ith sample that you calculated by sorting the data in ascending order.

2. Find the statistic’s p-value.
The formula for the p-value depends on the value for the AD statistic from Step 1.

Small p-values (less than your chosen alpha level) mean that you can reject the null hypothesis. In other words, the data does not come from the named distribution.
AD-Test Example in Excel:
Step1: Enter your data like the following (page 25 in the slides):

Step 2: calculate 2i -1
A. Select the cell you want to calculate its value

B. Enter “=” and select the A2 cell which contains “1"

C. Add to the cell you selected “*2 -1”

D. Tap “Enter” so the result will show on.

E. select all the cells then tap on Crtl +Enter so all the cells are calculated automatically.

Step3: Calculate ln(f(xi)), — x is A-Z order —
first, calculate Xi (A-Z) and Xi(Z-A)

then, calculate mean, standard deviation, and x

After that, calculate f(x)using Norm.Dist(x, mean, standard deviation, cumulative) for each cell. X is from A-Z

Finally, calculate ln(f(X))

Step3: Calculate ln(1-f(x)): x is Z-A order
first, calculate f(x), x from Z-A then calculate ln(1-f(x))

Step4: Calculate (2i-1) *( ln(f(x))+ ln(1-F(Xn-i+1)))
Calculate (2i-1) *( ln(f(x))+ ln(1-F(Xn-i+1)))

Step5: Caluclate S value
Using this formula:

first, calculate ((2i−1)/ n) * [lnF(Yi)+ln(1−F(YN+1−i))]

Then, we will do the sum for all cells

Step6: Calculate A² value
Using this formala :A² = |-n -S|.

Step6: Calculate A² critical value
- From this table, choose the nearest n value to your n data which is 9. This means we choose n =10
- After that, find the cross cell between %5 and n =10
- A² critical value is 0.683
Note: Significance level α usually = %5, this means if we repeat the experiment 100 times, we must have the same results in 95 times, and we are allowed to have a different result just in 5 times. The 5 different results = α

Step7: Compare A² with the A² critical value
We will compare A² with the A² critical value, if
- If A² < A² critical value then, you can consider your data distributed as a normal distribution.
- If A² > A² critical value then, your data is not distributed as a normal distribution.
A² = 0.219 and A² critical value = 0.683. Since 0.219 < 0.683 then, your data is distributed as a normal distribution.
or
you can calculate the p-value, then if p-value > α failed to reject.
You can access the data I worked on by clicking on this sheet.
See you in the next part.