Wednesday, April 5, 2017

Quantitative Methods: Assignment 4

Introduction
The purpose of this lab is to practice determining whether there is a difference between a sample set of data and a hypothesized set of data.  This is done using the steps of hypothesis testing to conclude whether to reject the null hypothesis (there is a difference), or to fail to reject the null hypothesis (no difference).  This will then be put into context by using real U.S. Census data to determine whether or not a difference in average house value exists between the City of Eau Claire and the County of Eau Claire as a whole.

Objectives:
      -Distinguish between a z or t test
-Calculate a z and t test
-Use the steps of hypothesis testing
-Make decisions about the null and alternative hypotheses
-                    -Utilize real-world data connecting stats and geography


Methodology
Part I: hypothesis testing, z tests and t tests

1)
Using the given data of the interval type, confidence level, and the number of observations (n), the task was to fill in the correct corresponding values for the rest of the chart in Figure 5.  This was done using the t and z test tables, as well as the formulas for the z and t test equations (Figures 1 & 2).

The interval type and confidence level are used to determine a.  One tailed interval types take the difference between 100 and the confidence level to give you "a" as a percent.  Two tailed interval types take the difference between 100 and the confidence level and divide that number by 2 to give you "a" as a percent.  If n is less than 30, it uses a t test, and n is more than 30 it uses a z test.  The z or t value is then acquired by using either the z or t charts (Figures 3 & 4).

Figure 1

Figure 2

Figure 3


Figure 4


2)
A Department of Agriculture and Live Stock Development organization in Kenya estimate that yields in a certain district should approach the following amounts in metric tons (averages based on data from the whole country) per hectare: groundnuts. 0.57; cassava, 3.7; and beans, 0.29.  A survey of 23 farmers had the following results: 
                                                     μ             σ          mh             t                 probability
                Ground Nuts      0.52        0.3        
                Cassava              3.3          .75        
                Beans                 0.34        0.12      

The goal in this section was to:
    a) test the hypothesis for each product, assuming that each is a two tailed interval type with a                   confidence level of 95%,
    b) present the null and alternative hypotheses as well as conclusions
    c) determine the probability values of each crop
    d) examine the similarities and differences in the results

The results for this section are in Figure 5.


3)
A researcher suspects that the level of a particular stream’s pollutant is higher than the allowable limit of 4.2 mg/l.  A sample of n= 17 reveals a mean pollutant level of 6.4 mg/l, with a standard deviation of 4.4.  It is assumed that a one tailed test with a 95% significance level with be used to follow the hypothesis testing steps.  The corresponding probability value as well as the conclusion is detailed in Figure 6. 

Steps in Hypothesis Testing:
    1) State the null hypothesis, Ho
    2) State the alternative hypotheses, Ha
    3) Choose a statistical test
    4) Choose a or the level of significance
    5) Calculate test statistic
    6) Make decision about the null and alternative hypotheses


Part II: Study Question
The objective in this part was to use two shapefiles to compare the average house values per block group in the City of Eau Claire and in Eau Claire County as a whole.  Using a significance level of 95% and a one tailed interval type, a z test was used from statistics in the attribute tables to see if a difference existed between the city and the county as a whole.  Then a map was created in Arcmap to display the average house values per block group.  The results for this part are in Figure 7.  



Results

Figure 5
  • a - significance level
  • z or t - which type of test 
  • z or t - critical value for the given significance level




                                                    μ             σ          mh             t                 probability
                Ground Nuts      0.52        0.3        0.57      -0.79936          21.19%
                Cassava              3.3          .75        3.7         -2.5577             0.52%
                Beans                 0.34        0.12      0.29        1.9984            97.72%
Figure 6
    Figure 6 shows the calculations made in t tests to determine the difference between the yields of the sample and the estimated values from the Department of Agriculture and Live Stock Development organization in Kenya.  The conclusion is that ground nuts and beans showed no difference, while cassava did show a difference.  In the ground nuts and beans calculations, the test result was to fail to reject the null hypothesis.  In the cassava calculations, the test result was to reject the null hypothesis.  







                                                  μ             σ          mh             t                 probability
         Stream Pollution     6.4           4.4       4.2             2.0615         98.03%
Figure 7
    Figure 7 shows the calculations made in a t test to determine if there was a significant difference between the allowable pollution level and the recorded level of the observed stream.  The corresponding t test determined that there was a difference, because the result was to reject the null hypothesis.  








Figure 7
n: 53
City Mean: 151876.51
County Mean: 169438.13
Standard Deviation (City): 49706.92


    This map helps to show how the City of Eau Claire has a large number of block groups with low average home values.  Using a one tailed interval type with a 95% significance level, a z test was used to calculate the result: a failure to reject the null hypothesis.  This means that there is not a difference using a one tailed interval type.  There is not a difference in the average house value in the City of Eau Claire compared to the County of Eau Claire.  However, if a two tailed interval type was used in the z test, the null would be rejected because the average house value in the City of Eau Claire is significantly less than that of the county as a whole.


Conclusion
Each value in the data used for hypothesis testing will influence the result of z and t tests.  They are used to determine whether or not there is a difference between the sample mean of a set of data and the hypothesized (set) mean.  The conclusion from Figure 7 shows how even choosing whether or not a one or two tailed test will influence the end result.




No comments:

Post a Comment