Friday, July 27, 2012

Z-test and t-test for the Mean; July 25, 2012





                                                        Introduction to the z and t-tests



                  Z-test and t-test are basically the same; they compare between two means to suggest whether both samples come from the same population. There are however variations on the theme for the t-test. If you have a sample and wish to compare it with a known mean (e.g. national average) the single sample t-test is available. If both of your samples are not independent of each other and have some factor in common, i.e. geographical location or before/after treatment, the paired sample t-test can be applied. There are also two variations on the two sample t-test, the first uses samples that do not have equal variances and the second uses samples whose variances are equal.






 Data types that can be analysed with z-tests




  • data points should be independent from each other
  •  z-test is preferable when n is greater than 30.
  •  the distributions should be normal if n is low, if however n>30 the distribution of the data does not have to be normal
  •  the variances of the samples should be the same (F-test) 
  •  all individuals must be selected at random from the population
  •  all individuals must have equal chance of being selected
  •  sample sizes should be as equal as possible but some differences are allowed

    Data types that can be analysed with t-tests


  • Data sets should be independent from each other except in the case of the paired-sample t-test
  •  where n<30 the t-tests should be used
  •  the distributions should be normal for the equal and unequal variance t-test (K-S test or Shapiro-Wilke)
  •  the variances of the samples should be the same (F-test) for the equal variance t-test
  •  all individuals must be selected at random from the population
  •  all individuals must have equal chance of being selected
  •  sample sizes should be as equal as possible but some differences are allowed
Example of z-test problem: 

      A researcher reports that the average salary assistant professors is more than 42 000. A sample of 30 assistant professors has a mean salary of 43, 260. At a=0.05, test the claim that assistant professors earn more than 42 000 a year. The standard deviation of the population is 5230. 


Step 1. State the hypothesis and identify the claim.  
Ho : μ ≤ 42 000     and   H1: μ   >  42 000 (claim) 

Step 2. Find the Critical Value. Since a=0.05 and the test is a right-tailed test, the critical value is z= 1.65. 



Step 3. Compute the Test Value 



Step 4. Make the decision. Since the test value, 1.32 is less than the critical value 1.65, and is not in the critical region, the decision is "Do not reject the null hypothesis." 


Step 5. Summarize the results. There is not enough evidence to support the claim that assistant professors earn more on average than 24 000 a year.

  

The four possible outcomes and the summary statement for each situation. 


The P-value Method
The Traditional method - Using Rejection Regions (critical value approach) 

Steps in Solving Hypothesis Testing Problems (P-Value Method)

Step 1. State the hypothesis and identify the claim.
Step 2. Compute the test value.
Step 3. Find the P-Value.
Step 4. Make the decision.
Step 5. Summarize the results.


Decision Rule Based on P-value
To use a P-value to make a conclusion in a hypothesis test, compare the P-value with α
1. If P ≤ α, then reject H0.
2. If P > α, then fail to reject H0.



Example 1: A researcher wishes to test the claim that the average age of lifeguard in Ocean City is grater than 24 years. She selects a sample of 36 lifeguards and find the mean of the sample to 24.7 years, with a standard deviation of 2 years. Is there evidence to support the claim at a=0.05? Find the P-Value.

Solution:
Step 1. State the hypothesis and identify the claim.
Ho: µ \le \!\, 24        H1µ > \!\, 24

Step 2. Compute the test value.






Step 3. Find the P-value. Using the Table E. in appendix C, find the corresponding area under the normal distribution for z= 2.10. If is 0.4821. Subtract this value from 0.50 to find the right tail.
0.5-.4821 + 0.0179.

Hence the p-value is 0.0179

Step 4. Make the decision. Since the p-value is less than 0.05, the decision is to reject the null hypothesis.

Step 5. Summarize the Results. There is enough evidence to support the claim that the average age of lifeguards in Ocean City is greater than 24 years.




By: Tito Nuevacobita Jr. III-Gold


No comments:

Post a Comment