how to calculate type 2 error?
You can only calculate the probability of a type 1 error. A type 1 error is made when the null hypothesis is true but we reject it. You can calculate the probability of this error because the null hypothesis is (or should be) mathematically precise stating what distribution and parameters are assumed to be involved. A type 2 error is made when the null hypothesis is not true but you accept it anyway. Since it is not true then you don’t know what the situation is. The distribution that you have assumed applies may not do so and even if it does you don’t know what the parameter values are. This means that you cannot make any calculation of the probability of this type of error. Normal practice is to set a maximum for the probability of a type 1 error (called the significance level of the test) and just hope that the probability of the other one is not too high. The only way to reduce the probability of both types of error at the same time is to have a larger sample size but in practical