Wednesday, April 5, 2017

Assignment 4

Introduction


This assignment is intended to help gain an understanding of z and t tests more thoroughly. It dos this by utilizing real-world data connecting stats and geography. The first step to this is to distinguish between a z test or a t test for any given set of data. After this, the assignment is focused on calculating both z and t tests. The next portion of the assignment is dedicated to using the steps of hypothesis testing. These are:

1. State the null hypothesis

2. State the alternative hypothesis

3. Choose the statistical test to analyze the data

4. Choose α or also known as the critical value

5. Calculate the test statistic

6. Make decision about the null and alternative hypothesis



Part 1: Z & T Tests


Question 1


Part 1's task is to fill out a  half filled table's critical value, choose whether or not the item needs a z or t test, and to calculate the z/t value of the item (Figure 1).


Figure 1: Part 1's table filled out in completeness.




Question 2


Question 2 asks one to determine how the agricultural yields in a certain district in Kenya compare to the rest of the county.  The three crops and the per hectare averages of the country are: groundnuts, .57; cassava, 3.7; and beans, .29. The null hypothesis is that the per hectare averages of the three crops within this district will be no different than the country's averages. The alternative hypothesis is that there are differences between the districts per hectare averages and the country's.

A t test will be utilized in this study, because there are only twenty-three samples from farmers included (Figure 2). If there were more than thirty samples, than a z test would be utilized.


Figure 2: Test used to calculate t score and z score.

t= t score value
μ= sample mean
μh= hypothesized mean
σ= standard deviation of sample
n= number of samples

T Values
ground nuts= -.799
cassava= -2.558
beans= 1.998


The given information provided lists the confidence level at 95%, and that each test will be two tailed. Because it is a two tailed test, the probability will be halved to accommodate values at either end of a distribution. This means the critical value is collected from 97.5% rather than 95%. The degree of freed (df) is 22 (23 samples - 1). 

critical values= 2.074, -2.074

With this knowledge conclusions on the hypothesis can be made.

Ground nuts= Fail to reject null hypothesis
    The t value of ground nuts, -.799, falls within the critical value of the data set and therefore it must fail to be rejected. 

Cassava= Reject the null hypothesis
    The t value of cassava, -2.558, falls outside of the critical value range, and therefore must be rejected.

Beans= Fail to reject the null hypothesis
    The t value of beans, 1.998, falls within the critical value range and therefore it must fail to be rejected.


Probabilities

Ground Nuts: 21.66%
Cassava: 1.07%
Beans: 97.03%



Question 3


Question 3 asks one to come to conclusions on a stream's pollutants levels using hypothesis testing. A researcher is worried that the level may be higher than the allowable limit of 4.2 mg/l. It is a one tailed test with a 95% significance level.

Given Information

n=17
μ= 6.4 mg/l
μh=4.1 mg/l
σ= 4.4

The null hypothesis is that there is no statistical difference between the stream's pollutant level and the allowable limit. The alternative hypothesis is that there is statistical difference between the stream's pollutants levels and the allowable values. A t test will be utilized as there are less than thirty samples.

Critical Value=1.746
t=2.155

The t value falls far outside of the critical values, and therefore the null hypothesis is rejected

Probability= 97.86%


Part 2

Part 2 is dedicated to determining if there is a significant difference in the average home value between the houses within the City of Eau Claire block groups, and the block groups for the County of Eau Claire. 

Null Hypothesis: There is no significant difference between the average home values in the City of Eau Claire compared to the County of Eau Claire.

Alternative Hypothesis: There is significant difference between the average home values in the City of Eau Claire compared to the County of Eau Claire.

Statistical Test:  A Z test will be used because there are greater then 30 samples.

The variables in the formula from figure 2 were found in the attribute table from the provided shapefiles. When the variables are ran through the formula, a test statistic of -2.572 is found. The confidence level is 95%, and the test employed is a one tailed test. The critical value is determined to be -1.64. This was done in question one of part one. The test statistic is lower than the critical value, so I reject the null hypothesis. This means there is a significant difference between the average home values of the block groups of the City of Eau Claire and the block groups of the County of Eau Claire. The probability of this is .51%, which means that only .51% of the data set is less the the City of Eau Claire's block groups data. That's a very small amount. Figure 3 displays this information in maps below.



Figure 3: Maps depicting the average house values by block group in Eau Claire County and City of Eau Claire.

The maps above show the information discussed in this blog post. As one can see, there are many more high value average block groups south of the City of Eau Claire within the County. This further supports the rejection of the null hypothesis and states that the averages of the City of Eau Claire's block group house value averages are statistically different than the block groups of the County of Eau Claire.