Type I and Type II Error Calculation Lecture 33

 Type I & Type II Error

Lecture 33

Determination of Critical Value “c”


The critical value is a threshold value that divides the distribution of a test statistic graph or curve into acceptance and rejection regions. The null hypothesis is rejected if the test statistic value lies within the rejection region; if not, it cannot be rejected. The critical value depends on alternative hypotheses, whether one-tailed or two-tailed. A two-tailed test will have two critical regions, and a one-tailed test will have just one critical region.

 

* when the alternative hypothesis of the form:

H0: θ ≠ θ0

Then c value can obtained as;


* when the alternative hypothesis of the form:

H0: θ θ0

Then c value can obtained as;

* when the alternative hypothesis of the form:
H0: θ θ0

Then c value can obtained as;

Inferential Error

In hypothesis testing, the sample data either confirms or refutes the null hypothesis. It is possible to make errors in this situation, such as rejecting a valid null hypothesis or accepting a false null hypothesis or incorrectly. Inferential error is the term for such errors.


1. Type Error

If an investigator rejects a true null hypothesis, then it is called a type I error. The probability of type I error is represented by α.


α =P(RejectH0 / H0 is true)

Examples:

i. A medicen is effective for the treatment of a disease and the doctor does not advise it.

ii. A helmet is important in bike driving, but the biker refuses the helmet. 

iii. A judge punishes an innocent person.

Main Causes of Type I Error

1. When a variable is influenced by a factor other than the variable under test. The outcome of this effect-causing element gives support to the rejection of the null hypothesis.

2. The significance level is established before the hypothesis test.

3. The careless establishment of the null hypothesis.

4. The small sample size and the null hypothesis are disregarded.

Type II Error

If an investigator accepts a false null hypothesis, then it is called a type II error. The probability of type II error is represented by β. 

                                                         β P(Accept H0 /H0 is False)

                                                        β P(Accept H0 / H1 is true)

Examples:
i. A medicen is not effective for the treatment of a disease, and the doctor advises it.

ii. A judge releases a guilty person.

iii. A teacher promotes a weak student to the next class.

Main Causes of Type II Error

1. The small sample size.

2. The selection of biased hypotheses.

3. The selection of poor sampling distribution.


Example 8.18: Given H0: μ  200 vs. μ < 200, n = 100, standard deviation = 25 and α = 0.05

1. For what values of the sample mean H0 be accepted?

2. Compute beta if u is actually 191.

3. Compute the power test, and what does it mean?

Solution: The null hypothesis will be accepted if the sample mean is less than or equal to the critical value.

The null hypothesis will be accepted if the sample mean is less than or equal to 195.8875; otherwise, it will be rejected.

It means a 97% chance of a false null hypothesis.

Example 8.19: A random sample of size n = 25 selected from a normal population with a standard deviation of 10. The null and alternative hypotheses are given below:
H0 : μ =170 vs. H1: μ >170
i. The null hypothesis is rejected if the sample mean is equal to or more than 172. Calculate the probability type I error.
ii. Compute the probability type II error if the true population is 173.
iii. Compute the power of the test if the sample mean is more than 172 and the true population mean is 173.

Solution:
i. The probability of type I error is given by;
α = P(Reject H0 / H0 is true)
α = P(X¯ 172 / H0 : μ = 170)
ii. The probability of type II error is given by:
β =P(Accept H0 / H1 is true)
β =P(X¯ < 172 / H1 : μ 173)
iii. Power of the test

π =1 - β
π =1 - 0.3085
π = 0.6915

How to reduce Type I & Type II Errors

 

Several strategies can be employed to reduce type I and type II errors.


*Type I errors can be reduced by selecting a lower level of significance at the start of the study. By setting the lower significance threshold, the probability of incorrectly rejecting a null hypothesis decreases.

* Increased sample size also reduces the probability of type I error and type II error.

 

The Power of a Test

The power of a test is the probability of making the correct decision if the alternative hypothesis is true. Or we can say the probability of rejecting a false null hypothesis. The power of a test is the complement of type II error.

π =1 - P(Reject H0 /H0 is False)

π =1 - P(Reject H0 /H1 is True)

π =1 - β

The power curve can be obtained by plotting parametric values under alternative hypotheses on the x axis and π values on the y axis and joints by line segments, which gives an "S" type curve.

Operating chrematistic Curve

(OC Curve)

The operating characteristic curve is the visual representation of the probability of type II error. To construct OC curve parametric values under alternative along x axis and probability of type II along y axis and gave a reverse “S” shaped curve. The OC curve is the complement of the power curve.

Example 8.20: A random sample of size 4 is selected from a normal population with a known standard deviation of 3.873. a hypothesis of the form u = 30 against u > 30 at 5% significance level. Calculate the following:

i. The critical value of the sample mean at which the null hypothesis is rejected.

ii. Type II error for values of u = 31, 32, 34, 35, 36, 37, 38 in the alternative hypothesis.

Power of the test and sketch power curve and OC curve.

Solution:


ii. Probability of type II errors:







Power of the test:

















Hypothesis about the Difference of two Population Means Lecture 32

 Hypothesis about the Difference of two Population Means

Lecture 32

To test the hypothesis about the difference between population means. The following cases are to be considered.

Case 1: Hypothesis about the Difference between Population Means when σ1, σ2 are known.

To test the null hypothesis that the difference between the two population means is zero or some specified value. Let two independent random samples of size n1, n2 selected from two normal populations having means μ1, μ2 and known standard deviations σ1, σ2. Let X¯1, X¯2 be the estimates of μ1, μ2 computed from the values of the selected samples. The sampling distribution of (X¯1 - X¯2) approaches normal distribution. 

Suppose it is desired to test μ1 - μ2 = 
Testing Procedure:
i. State the null and alternative hypothesis

H0: μ1 - μ2 = ∘ Vs. H1: μ1 - μ2 ≠ 
H0: μ1 - μ2 ≥ ∘ Vs. H1: μ1 - μ2 < 
H0: μ1 - μ2  ∘ Vs. H1: μ1 - μ2 > 
ii. The Significance Level; α 
iii. The test statistic: As  σ1, σ2 is known.
under H0.
iv. Critical Region:

Reject H0 when |z| ≥ zα/2
Reject H0 when z < - zα
Reject H0 when z > zα
v. Computation:
vi. Remarks

Case 2: Hypothesis about the Difference between Population Means when σ1, σ2 are unknown.

To test the null hypothesis that the difference between the two population means is zero or some specified value. Let two independent random samples of size n1, nselected from two normal populations having means μ1, μ2 and unknown standard deviations σ1, σ2. As σ1, σ2 are unknown, so replace by its estimates S1, S2. Let X¯1, X¯2 be the estimates of μ1, μ2 computed from the values of the selected samples. If the sample sizes are large, then the sampling distribution of (X¯1 - X¯2) approaches normal distribution. 


Suppose it is desired to test μ1 - μ2 = 

The testing procedure remains the same.

Example 8.13: Ten percent of the BS botany & BS zoology students are chosen in order to check whether the two departments’ performance in the statistics course is the same or different. Two independent random samples of 12 and 15 students each are chosen from the BS botany and BS zoology programs. Such kind of research was also conducted in the past in both of the departments, with the standard deviations of BS botany and BS zoology being 1.5 and 2.13, respectively. Two random independent samples of size 12 and 15 students are selected from BS botany & BS zoology, respectively. The sample average GPAs of BS botany & zoology are 3.40 and 3.67, respectively. Test the claim that the performance of students in the statistics course of both departments is identical at the 5% significance level.

Solution: Let μ1 & μ2 represent the average performance of students of the BS botany & BS zoology departments. We setup our null & alternative hypotheses as:

i. State the null and alternative hypothesis

H0: μ1 - μ2 = 0 Vs. H1: μ1 - μ2 ≠ 0
Example 8.14: A market investigator claims that the average sale of a corner shop is more than the non-corner shop. To check the market investigator, claim two random and independent samples each of size 60 days of the corner and non-corner shops gave the average sale is $100 and $85 with a standard deviation of $5.40 and $6.23. The claim of the market investigator is validated at the 0.5% significance level.
Solution: Let μ1 & μ2 represent the average sales of corner and non-corner shops. We setup our null & alternative hypotheses as:

 i. State the null and alternative hypothesis

H0: μ μ2  Vs. H1: μ1 > μ2
or we can state as: 
H0: μ1 - μ2  0 Vs. H1: μ1 - μ2 > 0
ii. The Significance Level; α 
iii. The test statistic: As  σ1, σ2 is unknown but n1, n2 are sufficiently large.
under H0.
iv. Critical Region:
Reject H0 when z > z0.03 = 2.807
v. Computation:

vi. Remarks: The computed z value falls in the rejection region; the sample data does not provide sufficient evidence to accept the null hypothesis at the 0.5% significance level. Thus, it is concluded that the market investigator claim is validated.

Alternatively, P value can be used to decide about the above hypothesis

P value = P (z < 13.24)

P value = 1- P (z < 13.24)

P value = 1- 0.999

P value = 0.001

The P value (0.001) is less than the significance level (0.005). The null hypothesis is rejected.

Example 8.15: All mid-level finance industry professionals have a known standard deviation of $1100. The financial sector is where Firms A and B operate. Two random independent samples of size 130 and 145 mid-level employees from firms A and B are collected. The sample mean salaries are $8000 and $9600 for mid-level professionals in Firm A and Firm B, respectively. The management of Firms A and B would like to know if there is a mean difference in the salaries of their mid-level professional employees.

Solution: Let μ1 & μ2 represent the veragemid-level employees from companies A and B  We setup our null & alternative hypotheses as:
i. State the null and alternative hypothesis

H0: μ1 - μ2 = 0 Vs. H1: μ1 - μ2 ≠ 0
ii. The Significance Level; α 
iii. The test statistic: As  σ1, σ2 is unknown but n1, n2 are large enough.
iv. Critical Region:

Reject H0 when |z| ≥ z0.05/2 = 1.96

v. Computation:
vi. Remarks: The computed z value falls in the rejection region, so the sample data does not provide sufficient evidence to accept the null hypothesis. Thus, it concluded the mean salaries of both firms are significantly different.

Hypothesis Testing about Difference between Population Proportions

Let p^1 and p^2 be the estimates of P1 and P2 computed the values of two independent random samples of size n1, n2 selected from two binomial populations having proportion of success P1, P1. If n1, n2 are sufficiently large, then the sampling distribution of (p^1 - p^2) approaches a normal distribution. 

If H0: P1 - P2 = D  ≠ 0,
Then the following test statistic will be used:
If H0: P1 - P2 = 0
Then the following test statistic will be used:

The testing procedure remains the same.

Example 8.16: A random sample of 150 LED TVs manufactured by a company A showed 12 defective LED TVs, while a random sample of 100 LED TVs manufactured by another company B showed 4 defective LED TVs. Is there a significant difference between the proportion of defective LED TVs of two firms?

Solution: Let P1 and P2 be the proportion of defective LED TVs produced by companies A and B, respectively.

i. H0: P1 - P2 = 0 Vs. H1: P1 - P2 ≠ 0
ii. The significance level; α = 0.05
iii. The test statistic: As n1 & n2 are large enough, then

iv. Critical Region:
Reject H0 if |z| ≥ z0.05/2 = 1.96

v. Computation:

vi. Remarks: The computed z values fall in the acceptance region; the sample data does not provide sufficient evidence to reject the null hypothesis at the 5% significance level. Thus, it is concluded that the proportion of defective LED TVs produced by both companies is the same.

Example 8.17: The purpose of the study is to compare the proportions of adult patient responses to two different types of flue treatment. Twenty of the 200 people assigned to Medicine A respond in better condition. Then medicine B is prescribed; the remaining 200 patients exhibit the same flu-like symptoms, while 12 respond better. According to a doctor, drug A works 10% better than drug B.

Test at a 1% level of significance.

Solution:

i. H0: P1 - P2 = 0.10 Vs. H1: P1 - P2 ≠ 0.10
ii. The significance level; α = 0.01

iii. The test statistic: As n1 & n2 are large enough, then
iv. Critical Region:
Reject H0 if |z| ≥ z0.01/2 = 2.5758


v. Computation:

vi. Remarks: The computed z value falls in the acceptance region; the sample data does not provide sufficient evidence to reject the null hypothesis. It is concluded that the drug A is 10% more effective than drug B.

Moving Average Models (MA Models) Lecture 17

  Moving Average Models  (MA Models)  Lecture 17 The autoregressive model in which the current value 'yt' of the dependent variable ...