Вы находитесь на странице: 1из 9

Any Contingency

- Statistics 1: Real Data Shared A Historic Note A few years ago, my Year 10 class in Adelaide exchanged data with students attending a school in Belfast, Northern Ireland. We used e-mail attachments of pictures and spreadsheets on very slow and unreliable dial-up connections. While we were enjoying lovely spring mornings on the lawns outside our classroom, the students in
Students in Belfast

Belfast suffered the beginnings of Winter. When we attached photographs to our e-mails the students in Belfast were quite envious of our climate. We experimented with some e-mail chat between individuals but our main purpose was to exchange real data about ideas that students were concerned
Students in Adelaide

about at that time.

Groups of students in both classes made up questions that they discussed with corresponding groups in the other class by e-mail. When finalised, the questions were put into a series of spreadsheets about different areas of interest. Here is the top part of the Sport Question Sheet. The spreadsheet was designed with a vertically split screen. The questions were entered to the left of the split and the answers were entered to the right of the split. As each student entered a column of answers, the right-hand screen was moved so that the previous answers were hidden behind the split. In that way, when new people came to answer the questions, they could only see their own answers. People who make up questionnaires usually work out how they are going to process the answers before they design the way they want the questions asked. However, we wanted our students to discover these issues for themselves.

Copyright 2007, Hartley Hyde

Page 1 of 9

Any Contingency
Finding the Answers In this lesson we are going to work with the answers that students from both schools gave to the second question.
A friend claims that all school sports teams should have equal numbers of boys and girls. Do you agree? (Type "Y" in this cell if you agree and "N" if you don't.)

A copy of the data has already been retrieved from the spreadsheets for you and placed into a ClassPad file that can be downloaded from www.casioed.net.au Data Types Different types of data vary in how precise they can be and in what kinds of statistics we can use to describe them. For example, we could talk about Bills height very vaguely by saying he is tall for his age, we could be more precise and say that he is taller than Mary but not as tall as Bob or we could be very precise by using a tape measure. Statisticians distinguish between four types of data. Ratio When we weigh or measure something we can say that one thing is twice as heavy or three times as high as something else. Measurements like these allow us to be very precise. Interval If we find the temperature of something, we can also be very precise. We are able to say that the interval between 70C and 80C is twice the interval between 30C and 35C. However, it is difficult to say that one cup of coffee is twice as hot as another cup of coffee. Do we mean relative to air temperature or do we mean relative to one of the various zeros? Ordinal Ordinal data may consist of words, numbers or symbols that can be placed in order or ranked. For example, we can say that Sergent > Corporal > Private. In a questionnaire we may ask if people Strongly Disagree, Disagree, Agree or Strongly Agree. We cant say that the interval between Agree and Strongly Disagree is twice the interval between Agree and Disagree. Nominal We can also use words or numbers to classify things. For example, the numbers on license plates do nothing more than distinguish between cars. They dont usually measure anything.

Copyright 2007, Hartley Hyde

Page 2 of 9

Any Contingency
One Small Problem At the time this lesson was written, the statistics application in your ClassPad was not able to calculate statistics from ordinal or nominal data. However, there is a command in the spreadsheet that can check if two words are the same. Here is how to build your own statistical tool for using the spreadsheet with nominal data. The =CellIf formula In cell B2 of this spreadsheet is a CellIf formula. It reads: =CellIf(A1="Green","My Favourite","Oh! Yuk"). This has been used to Fill the Range B1:B10. The command has two commas. Between the commas are three parts. The first part, A1="Green", is a test. It checks to see if the word in column A is the same as the string "Green". If the Test is true, ClassPad looks at what is written between the two commas and types "My Favourite". If the Test is False, ClassPad looks at what is written after the second comma and types "Oh! Yuk". The Data File Open the file Belfast. Look down columns A and B. There should be 200 rows. Check that the cells in column A contain either the word "Adelaide", or the word "Belfast". Check that the cells in column B contain either the letter "Y" for Yes or the letter "N" for No. We are going to build a grid (E2:F3) that is two boxes wide and two boxes deep. In the boxes we are going to count how many students from "Adelaide" said "Yes" and how many said "No". Then we are going to count how many students from "Belfast" said "Yes" and how many said "No".

At cell D2 type the word Adelaide. At cell D3 type the word Belfast. At cell E1 type the letter Y and at the cell F1 type the letter N. Right justify these cells.

Copyright 2007, Hartley Hyde

Page 3 of 9

Any Contingency
Translating Words to Numbers ClassPad may not know how to process "Adelaide" or "Belfast", but it does know all about "O"s and "1"s. It is enough that it can see if strings match properly. Therefore we are going to use CellIf statements to change the string data into "O"s and "1"s. At cell I1 type the formula: =CellIf(D$2=A1,1,0) and then press E. From the Edit Menu tap on Fill Range. In the dialogue box, alter the range to I1:I200. When you tap OK you should find a column of "O"s and "1"s. Each "1" in a row, corresponds to the word "Adelaide" in the same row and in column A. At cell J1 type the formula: =CellIf(D$3=A1,1,0) and then press E. From the Edit Menu tap on Fill Range. In the dialogue box, alter the range to J1:J200. When you tap OK you should find a column of "O"s and "1"s in column J and each "1" in a row, corresponds to the word "Belfast" in the same row and in column A.

At cell K1 type the formula: =CellIf(E$1=B1,1,0) From the Edit Menu tap on Fill Range. In the dialogue box, alter the range to K1:K200.

and then press E.

When you tap OK you should find a column of "O"s and "1"s in column K and each "1" in a row, corresponds to the letter "Y" in the same row and in column B. At cell L1 type the formula: =CellIf(F$1=B1,1,0) From the Edit Menu tap on Fill Range. In the dialogue box, alter the range to L1:L200. When you tap OK you will find a column of "O"s and "1"s in column L and each "1" in a row, matches to the letter "N" in the same row and in column B. Check at rows 56 to 72 that the pattern of "O"s and "1"s matches the words in Columns A and B. Check again at rows 190 to 200 that the pattern of "O"s and "1"s matches the words in Columns A and B.

Copyright 2007, Hartley Hyde

Page 4 of 9

Any Contingency
Boolean Algebra In this section we are going to think about what the word and means. Suppose we have two statements A and B that we could put into a sentence. For example: Suppose Jack and Jill meet Cinderella. Suppose Jack says Hi Cindy, my name is Jack and this is my sister Jill. Now we could divide this sentence into parts like this: A = my name is Jack and B= this is my sister Jill In this case, both A and B are true and so the whole sentence is true. This is shown in this first table as True and True = True. A True True False False B True False True False A and B True False False False a 1 1 0 0 b 1 0 1 0 axb 1 0 0 0

But, suppose that Jack had said Hi Cindy, my name is Jack and this is my sister Judith. Now statement A is still True but statement B is False which makes the whole sentence False. When we join the two statements with the word and we can see that True and False = False as shown in the second line of the statement. Similarly, Jack might give himself the wrong name and we can then consider the other two possibilities shown in the table where A could be False.

Now consider the second table. Here we have a pattern of "O"s and "1"s that exactly matches the True and False statements of the first table. We can also see that it forms a perfect multiplication table for the numbers "O" and "1". In other words we can use the arithmetic of "O"s and "1"s to study the logic of truth tables.

There is a whole algebra associated with truth tables, set theory and the arithmetic of "O"s and "1"s. It is called Boolean Algebra because it was first investigated by George Boole. Computers and other digital devices, such as your ClassPad, make extensive use of "O" and "1" arithmetic for both logic and calculations.

Copyright 2007, Hartley Hyde

Page 5 of 9

Any Contingency
Back to your ClassPad The 1 in cell I1 tells us that it is true that the word in cell A1 is Adelaide. The 1 in cell K1 tells us that it is true that the letter in cell B1 is Y. At cell N1 type the formula: =I1*K1 and then press E.

This will work out that 1 x 1 = 1 but it also works out the truth of the statement that The word in cell A1 is Adelaide AND the letter in cell B1 is Y. From the Edit Menu select Fill Range and edit the range to N1:N200. Press OK. Similarly we can find all the folk from Belfast that said Yes: At cell O1 type the formula: = J1*K1 and then press E.

From the Edit Menu select Fill Range and edit the range to O1:O200. Press OK. And for the corresponding statement that folk said No: At cell P1 type the formula: = I1*L1 and then press E.

From the Edit Menu select Fill Range and edit the range to P1:P200. Press OK. At cell Q1 type the formula: = J1*L1 and then press E.

From the Edit Menu select Fill Range and edit the range to Q1:Q200. Press OK. The Contingency Table At cell E2 we want to count how many people from Adelaide said Yes. Now in Column N we have all of those people marked with a 1. All we need to do is add up column N and we know what number to put in the first cell of the contingency table. At cell E2 type the formula: =sum(N1:N200) At cell E3 type the formula: =sum(O1:O200) At cell F2 type the formula: =sum(P1:P200) At cell F3 type the formula: =sum(Q1:Q200) and then press E. and then press E. and then press E. and then press E.

Copy your contingency table into this space and say what you think it means. Y Adelaide Belfast N

Checkpoint

Copyright 2007, Hartley Hyde

Page 6 of 9

Any Contingency
Finishing the Contingency Table The four cells of the contingency table is only a first step. Next we add totals to our contingency table like this: At cell E4 type the formula: =E2+E3 and then press E. At cell F4 type the formula: =F2+F3 and then press E. At cell G2 type the formula: =E2+F2 and then press E. At cell G3 type the formula: =E3+F3 and then press E. At cell G4 type the formula: =G2+G3 and then press E. That completes what we actually measured. To emphasise that, at cell D1 type: Actual and press E. The Expected Values When we toss a well-balanced coin we expect that we will get heads about half the time. If we tossed a coin 200 times we might be surprised if we got exactly 100 heads, but we would expect to get close to that. If we kept getting quite different results we would start to think the coin was not well balanced. Similarly, we can build an expectation of what we will find in the sport question. The survey results in a total of 113 Yes answers. Since 67 of the 200 people answering the question are from Adelaide, we might expect that proportion, 67:200, of the 113 answers might be from Adelaide. Thus we expect to get 67*113/200 Yes answers from Adelaide and 133*113/200 Yes answers from Belfast. If we get something very different we might suspect that young people in Belfast think differently about this question than young people in Adelaide. At cell D7 type: Exptd At cell D8 type: =D2 At cell D9 type: =D3 At cell E7 type: =E1 At cell F7 type: =F1 At cell E8 type: =E10*G8/G10 At cell E9 type: =E10*G9/G10 At cell F8 type: =F10*G8/G10 At cell F9 type: =F10*G9/G10 and then press E. and then press E. and then press E. and then press E. and then press E. and then press E. and then press E. and then press E. and then press E.

Copyright 2007, Hartley Hyde

Page 7 of 9

Any Contingency
Time for Checkpoints Looking at the actual result, compared with our expected result, what conclusion can you reach?

It would have been interesting to see how responses to this particular question correlated with gender, but for some reason the school in Belfast chose to delete the question intended to identify the gender of each respondent. To build this 2x2 contingency table we used eight columns of Boolean numbers (0s and 1s). Using the same construction method, how many columns would we need to build a 3x4 contingency table?

Checkpoint Save your file as SportQ because you will need it again.

Copyright 2007, Hartley Hyde

Page 8 of 9

Any Contingency
Checkpoints
Students are building a tool and learning something of Boolean Logic. Many students may have difficulty with these concepts if they are new to them. However, a brief mention like this often establishes a little prior learning that will aid understanding if they ever return to this type of reasoning.

Checkpoint 1 Four correct numbers in the table is the main aim at this stage. If some students used the table to notice things like: Students from both cities were slightly more likely to favour the idea or that The proportion of those in favour was about the same for both cities before we started to consider expectation, then that would be a most pleasing outcome at a Year 10 level. Checkpoint 2 At this stage most students should be able to see that the answers to the question are very much as expected and that this particular group of students in Belfast thought very much as those in Adelaide about this question. A 3x4 contingency spreadsheet would need one column for each margin entry 3 + 4 = 7 columns and then it would need another column for each table square 3 x 4 = 12 columns Therefore we would need 19 columns all together. Warning Even this 2x2 example goes very close to filling the memory of my ClassPad. Do not set a larger example for homework until you have checked that it will fit.

Copyright 2007, Hartley Hyde

Page 9 of 9

Вам также может понравиться