homework

profileHershy360
HomeworkAssignment4gis.docx

Chi-Square Goodness of Fit and Independence (50 points)

For this homework assignment, you will use hand calculations and JMP software to work through the problems in order to develop an understanding of inferential statistics using Nominal data. The inferential statistics we will be using in this class with nominal data are Chi-Square Goodness of Fit and Chi-Square Measures of Independence.

Please work through the following problems on your own. Feel free to consult other students if you need help, but please, complete the homework assignment on your own. Avoid plagiarism or duplicate copies of other students, per the University of Florida academic code.

For hand calculations, please show all steps of the calculation for credit. This can be submitted as a scanned copy of a hand-written sheet, or through online on word or an excel document. If the answer is written with no calculations – you will receive no credit for that question.

For all problems that you are to use JMP, a screenshot or picture of each output must be included for full credit. Without this proof, no credit will be given.

For all examples, we will assume an alpha of 0.05.

1. You and a friend are planning to use a coin in order to decide who gets to go on a free vacation. The winner of a coin toss will win the trip. However, prior to the coin toss, you want to check to make sure the coin is fair. You therefore wish to use a Chi-Square Goodness of Fit test, along with a randomly flipping the coin 20 times, in order to make sure it does not significantly vary from the expected distribution. For this example, the expected frequency of a heads is 0.5, and the expected frequency of a tails is 0.5. Please calculate the Chi-Square by hand for the following data in the table below, keeping in mind that there are 20 samples, so adjust your expected frequency as necessary (10 points):

Heads

12

Tails

8

Total

20

a. Fill in the information in the following table to help you calculate a Goodness-of-Fit Chi-Square (4 Points):

Values

fo

fe

fo - fe

(fo - fe)2

(fo - fe)2/ fe

Heads

Tails

=

=

b. How many degrees of freedom are in this example? (1 point)

c. What are the null and alternative hypotheses in this example? (2 points)

d. Use the Chi-Square Critical Values table (Appendix J.2 in your book). What is the critical value? (1 points)

e. Based on this information, what do you conclude based on the critical value and chi-square goodness-of-fit statistic? (2 point)

2. Now, create a dataset in JMP from the 20-coin flip observations used in question 1. We will now calculate the Chi-Square Goodness of Fit for this data in JMP. (8 points)

a. After opening the data, navigate to Analyze > Tabulate. Under columns, drag the Coin Flip Result column into the drop zone for rows. This is an easy way to summarize nominal data. Provide a screen shot of the table. (1 points)

b. Exit out of the tabulate menu. Now, navigate to Analyze > Distribution. In the columns section, either double click the Coin Flip Result or drag it over to the Y, Column’s role. Click OK. You will now see a bar graph of Coin Flip Results, showing the frequency of Tails and Heads, along with a Frequencies graph, similar to the tabulate result in 2.a of this homework. Click the red down arrow next to “Coin Flip Result”, navigate to histogram options, and click the “Count Axis” option. You should now see an observation count below the bar chart. Provide a screenshot of the bar graph. (1 points)

c. We will now calculate the Goodness-of-Fit Chi-Square for this data. Click the red down arrow next to “Coin Flip Result” and navigate to “Test Probabilities”. You will now see the test probabilities box open below the frequencies table, along with the estimated probability and a box for hypothesized probability. Since we hypothetically using a fair coin, the hypothetical probabilities should be 0.5 for heads, and 0.5 for tails. Enter 0.5 into the “Hypoth Prob” boxes. Next, you will select an alternative hypothesis for testing probabilities. Remember, our null is that there is no difference between the estimated probabilities and the hypothesized probabilities. Since we are interested in only if they are equal or not, select the first option “Probabilities not equal to hypothesized value (two-sided chi-square test). Click Done. Please provide a screenshot of the entire “Test Probabilities” box and interpret your results. Was there a difference in result from your hand-calculated result and the one calculated in JMP? What is your conclusion? (6 Points)

3. Next, we will calculate a Chi-Square Test of Independence. We will again first do the calculations by hand in order to help solidify your understanding of the inner workings of the statistic, then we will calculate the statistic in JMP. For this example, we are interested in seeing if political affiliation has any association to whether someone likes oranges or not. For this data, we have two nominal variables: 1) Political affiliation (Democrat, Republican, or No Party Affiliation), and 2) If the person likes oranges (Yes or No). The data are in the table below: (22 points)

Party Affiliation

Likes Oranges

D

N

R

No

9

15

2

Yes

6

16

12

a. First, calculate the expected frequencies for each cell. Fill in the expected frequencies below. Remember, the formula for expected frequencies of each cell is: (4 points)

(frequency of its row)(frequency of its column)/Total n.

Party Affiliation

Likes Oranges

D

N

R

Marginal Total

No

26

Yes

34

Marginal Totals

15

31

14

60

b. Now, fill in the table to calculate the Chi-Square statistic, using the expected frequencies calculated in step a. These are the steps for the following formula: (4 points)

Values

fo

fe

fo - fe

(fo - fe)2

(fo - fe)2/ fe

1

2

3

4

5

6

=

=

c. What are the null and alternative hypotheses in this example? (1 point)

d. For this example, what are the degrees of freedom? Be careful, and remember this formula is different from Goodness-of-Fit. (1 point)

e. Use the Chi-Square Critical Values table (Appendix J.2 in your book). What is the critical value? (1 point)

f. Based on this information, what do you conclude based on the critical value and chi-square statistic? (2 points)

g. True or False, one of the assumptions we make in Chi-Square Test of Independence is that each sample is independent, and without this assumption we could not run this current statistic. (1 point)

h. We will not calculate the effect size. For this example, do we use a phi coefficient or Cramer’s V to calculate effect size? Why do we use the one selected over the other for this particular example? (2 points)

i. Please use the equation you selected in h to calculate effect size. What is the effect size, and how do you interpret this (small, medium, large effect?)? Please show your work for this calculation, step-by-step. (4 points)

j. At this stage we would perform a post-hoc analysis to test stepwise relationships between variables to check for differences. However, since this is a tedious process, we will only do this step in JMP. However, if we were to do the post-hoc calculations, we would use the Bonferroni method when we tested for significance. Explain why we use the Bonferroni method and calculate what the alpha will be for each test when the Bonferroni method is used. (2 points)

4. We will now perform the above example in JMP in order to calculate the Chi-Square Test of Independence. Create a dataset in JMP for the data outlined in question 3. We will now calculate the Chi-Square Test of Independence for this data in JMP. (10 points)

a. After opening the data, navigate to Analyze > Tabulate. Under columns, drag the Like Oranges column into the drop zone for rows, and the Party Affiliation column into the drop zone for columns. This is an easy way to summarize nominal data. Provide a screen shot of the table. (1 point)

b. Exit out of the tabulate menu. Now, navigate to Analyze > Fit Y by X. Drag party affiliation to the Y, response box, and Like Oranges into the X, Factor box. Click OK. You will now see a mosaic plot with party affiliation on the Y-axis, and Like Oranges on the X axis. This is another way to visualize frequency. You will also see a contingency table below the mosaic plot, and a tests block. Click the red arrow next to contingency table and select “Expected” from the dropdown menu. This is the expected frequency for each cell and should match those you calculated above. Use the red arrow and dropdown menu to remove “Total %” “Col %” and “Row %”, so that only count and expected is showing. Take a screenshot of the contingency table showing only these two variables in the cells. (1 point)

c. We will now view the Chi-Square Test of Independence for this data. Please provide a screenshot of the entire “Test” box and interpret your results. Was there a difference in result from your hand-calculated result and the one calculated in JMP (note that p-value is used instead of critical value, although this is the exact same interpretation)? What is your conclusion? (3 points)

d. Earlier in this course, we talked about how relationships can be statistically significant, but what we term spurious. How do you feel about our interpretations we can draw from this example? Do you really believe that political affiliation would impact orange preference, or do you feel this could be a spurious relationship? Please provide a response in paragraph form, supporting your answer. (5 points)

**At this stage we would perform a post-hoc analysis to find individual relationships, using the Bonferroni method and calculate our effect size. Due to the length of this homework assignment, we will end this analysis here. There is no need to answer this question, but this is just a reminder.

2