We took a survey of people in four career fields and found if they were left or right handed. These are the observed counts. Most of the respondents are right handed except for in the athletics field, where a few more than half are left handed. We want to know if this difference is a fluke or if career and handedness are somehow dependent. We have a 2x4 crosstab, so we should use a chi-squared test. These are the results: Degrees of freedom = χ2 = There is evidence against independence. We have a 2x4 crosstab, so we should use a chi-squared test. These are the results: Degrees of freedom = _______ χ2 = ________ There is _____________ evidence against independence. The chi-squared test has a very small p-value (less than .001). Do the results of this test tell us that there are more left handed people in athletics in general? The chi-squared test has a very small p-value (less than .001). Do the results of this test tell us that there are more left handed people in athletics in general? _______ Chi-squared only checks whether two variables are independent, not specific trends within them. By comparing the expected and observed counts, we can see that the athletic field is much different from the others. We can use this information to guide a next step even if we’re not getting definite answers from just the expected counts. We could try merging the other three fields into “non-athletic” and “athletic”, as long as those three fields together fairly represented everything non-athletic. In that case, the odds ratio shows that someone in the athletic field has _________ times the odds of being left handed as someone in a non-athletic profession. The confidence interval shows that this odds ratio is significantly more than ___ at the ____________ level. One more cross tab analysis. Because they belong in pairs. We randomly selected 150 people from the pool of righthanded people, 70 from the pool of left-handed people, and 10 ambidextrous people (who use both hands equally well). Then we performed a brain scan and found that some people’s brains operated in a “mirrored” fashion to most other people. (The opposite half was activated that what we would expect) Ordinary Mirrored Total Right 126 24 150 Left 37 33 70 Both 4 6 10 Total 167 63 230 Ordinary Mirrored Right 126 24 Left 37 33 Both 4 6 Total 150 70 10 Total 167 63 230 a) What is the probability of someone from this sample having mirrored brain activity? Probability uses the frequency of the event in question and the total. Pr(Mirrored) = # that are mirrored / # total ___________________________ Ordinary Right 126 Left 37 Both 4 Total Mirrored 24 33 6 167 63 Total 150 70 10 230 a) What are the odds of someone from this sample having mirrored brain activity? Odds use the frequency of the event and the frequency of everything that wasn’t the event. Odds of Mirrored = # mirrored to # not mirrored = ____________________ Or: Pr / (1-Pr) = .273/(1-.273) = __________ b) Why can’t we use this data to estimate the probability and odds that someone has mirrored brain activity in the population as a whole?* We selected 150 righties, 70 lefties, and 10 ambidextrous people on purpose. They weren’t randomly selected. We may have done this to increase the number of left-handed people to improve the quality of methods like the chi-squared test. If we used this data to talk about the whole population (if we inferred something about the population) we would be assuming that about 70/230 or 30% of people are left handed. (In reality, it’s more like 12%) Each left-handed person had a greater chance of being in our sample than each right-handed person, so the chances of being in the sample weren’t equal throughout. That makes the sample, with regards to handed-ness, not random. Right Ordinary Mirrored 126 24 Total 150 Left 37 Both 4 Total 33 6 63 70 10 230 167 e) What are the odds of someone in this sample having mirrored brain activity _________ on them being right-handed? Only use the data from the right-handed cases because of the condition. Odds = ____________________ e) Can we estimate the odds of a right-handed person in the population having mirrored brain activity? ________The distortion from selection a certain proportion of left/right/both handed people doesn’t affect our estimate when we’re only considered one type of handedness to begin with. For this question, we’re only interested in right-handed people, so that’s our _______________. Every righthanded person had an equal chance of being in the same, therefore sampling was random. What’s the difference between parts C and E? Why is it okay to infer for only right handed people and not every one? When considering all people Sample Population Right 65% 83% Left 30% 12% Both 5% 5% When only considering right-handed people Sample Population Right 100% 100% Left 0% 0% Both 0% 0% When considering all people Sample Population Right 65% 83% Left 30% 12% Both 5% 5% If we had picked the number of left/right handed people to match the population, this would have been a __________ sample. Each of the types of handedness would be a _________, and the brain activity would be the value of interest. We want to test if handedness/brain activity are independent. Ordinary Mirrored Right 126 24 Left 37 33 Both 4 6 Total 167 63 Total 150 70 10 230 We would use the _____________ test. However, there is a potential problem. We have very few people in the both-handed cells. Chi-squared generally needs an expected frequency of_______ in each cell to be accurate. Ordinary Mirrored Right 126 24 Left 37 33 Both 4 6 Total 167 63 Total 150 70 10 230 The common solution: ____________________ Which two should we merge? For any benefit, it has to be ______________ with something? In this case, it makes more sense to merge Left-handed and Both-handed. The frequencies indicate they are the two more similar categories. Ordinary Right 126 Mirrored 24 Total 150 Other 41 39 80 Total 167 63 230 Now we have a 2x2 cross tab. In this case, we could use either the chi-square or the ______________. The odds ratio is easier to compute, and it lets us do one-tailed tests, so we’ll do that. Ordinary Mirrored Right 126 24 Other 41 39 Total 167 63 Total 150 80 230 Odds ratio by quick formula: AD/BC OR = (126)(39) / (24)(41) = __________ The odds of having mirrored brain activity if you something other than right handed is 4.99 times as much as it is when you are right handed. Ordinary Mirrored Right 126 A 24 C Other 41 B 39 D The interpretation of the odds ratio is found directly in the quick formula: AD/BC The odds are (OR) times higher if (A or D) instead of (B or C) Here, that’s the odds of (Ordinary Righthand or Mirrored Left/Bothhand) are 4.99 times higher than (Ordinary Left/Bothhand or Mirrored Righthand) The 95% confidence interval of the odds ratio is (2.656 to 9.389) That means at alpha = 0.05, the handed-ness and having mirrored brain activity or not are dependent on each other. Why? The odds ratio of 1 is not in the confidence interval. An odds ratio of 1 implies that the odds of one thing are just as much as the odds of another thing. In our case that would be the odds of having a mirrored brain are the same regardless of handedness. This slide for interest, skip in lecture: Technically, we could use our sample to infer to the population (for all handedness), but we would need a method called weighting. Since we oversampled the left-handed people, we could use a weighted probability that counts each sampled left-handed person for less so that their total contribution to the probability, their WEIGHT in other words, matched the proportion of people that are left handed in the population. Here, lefties are 30% of the sample, but 12% of the population, so each lefty would count for a 12/30 of a sampled person. (blank for notes, picture in filled) 19 slide example problem, woo! All that leaves is AnOVa A simple ANOVA in a familiar form. Around Week 7-9, we looked at how to find a difference between the means of two groups. We did this by taking a sample mean from each group and comparing the difference to the ________________ Our method of testing whether this difference was significant (in other words, testing the null hypothesis that the difference between the true means was _______) was the t-score. It was always t = (difference) / Standard Error. The definition of standard error depended on the details (paired/independent, pooled/non-pooled standard deviation) If the difference was bigger, the t-score was bigger and we more often rejected the null hypothesis. It’s easier to say a difference is real when the sample mean difference is larger. (Easier to detect larger effects) If there was more scatter between the points within a group, the standard error got bigger, and we more often failed to reject the null hypothesis. Standard error also gets smaller when there are more data points. In every case that the t-test is used, you’re ultimately just answering one question over and over again: Are the differences ________ the two groups large compared to the differences _________ each group? Can we use the t-test to determine if there are differences between any of the three means from three samples? We can’t do this all as a single t-test, because the t-test is only a comparison between _______ sample means. We have three We could test each pair of groups and look for differences. If we found a significant difference between two means, that would imply that not all the means are the same. We’d need to test: Mean of group 1 vs group 2 Mean of group 2 vs group 3 Mean of group 1 vs group 3 Doing multiple t-tests takes time, and what’s worse: It opens up the issue of multiple testing (the more tests you to, more likely you are to commit an error like falsely rejecting the null) A much cleaner solution is the ___________ of ANOVA. MS stands for __________, and MSwithin is the average squared difference from a data point to the average for the that group. It’s the mean squared WITHIN a group If we were just looking at a single group, this average squared distance would be the standard deviation squared, or the ____________. MSwithin is large when the spread within the samples is large. Spread/variance within a sample makes it hard to detect differences between the samples, and so the F-statistics gets smaller, just like the t-statistic. MSbetween is large when there are large differences between the sample means. MSbetween stands for the differences between means, instead of within them. Here, the average (squared) difference from a group mean to the ____________, the average of data points from all the groups put together, is much larger than the differences between each point and its group mean. F will be large and there is strong evidence that there is some difference is the true means between the groups. Next time: More on ANOVA, ANOVA tables, and examples.