Tuesday, May 10, 2016

The five number summary and frequency tables


Let's say we have the length of a list n. We know how to find the position of the median once everything has been put in order by the formula (n+1)/2. That is because the list starts at position 1 and ends at position n.  Let's see how we can use this to find the positions of Q1, the median of the low half of the data, and Q3, the median of the high half of the data.

Assume n = 27 and the data is in order from low to high. (27+1)/2 = 28/2 = 14, so the median is in position 14.

Q1: The low half of the data is in positions 1 through 13, so (13+1)/2 = 14/2 = 7, and Q1 is in position 7.

Q3: The high half of the data is in positions 15 through 27. (15+27)/2 = 42/2 = 21, and Q3 is in position 21.

Another example when n = 42.

(42+1)/2 = 21.5, so the median is the average of the values in positions 21 and 22.

Q1: The low half of the data is in positions 1 through 21, so (21+1)/2 = 22/2 = 11, and Q1 is in position 11.

Q3: The high half of the data is in positions 22 through 42. (22+42)/2 = 64/2 = 32, and Q3 is in position 32.

Let's see if we can use this information with a frequency table. The first number is the value and the second number is the frequency.

12, 5
11, 4
10, 3
9,  4
8,  2
7,  4
6,  3
5,  1
4,  2
3,  2
2,  2


The sum of the frequencies is 32.  The position of the median is at (1+32)/2 = 16.5, between positions 16 and 17.

In this data set ordered from top to bottom, the positions 1 to 16 have the high half of the data and the positions 17 to 32 have the low half.  All this does is change which quartile is at which position, not the method of finding the quartile.

Q1: The low half of the data is in positions 17 through 32, so (17+32)/2 = 49/2 = 24.5, and Q1 is between positions 24 and 25.

Q3: The high half of the data is in positions 1 through 16. (1+16)/2 = 17/2 = 8.5, and Q3 is between positions 8 and 9.

We now need to find the values in the positions 8 and 9, 16 and 17 and 24 and 25.  Here is the list with the positions added in. An asterisk (*) will mark the important values

12, 5 positions 1 through 5
11, 4
positions 6 through 9 *
10, 3 positions 10 through 12
9,  4 positions 13 though 16 *
8,  2 positions 17 and 18 *
7,  4 positions 19 through 22
6,  3 positions 23 through 25 *
5,  1
position 26
4,  2 positions 27 and 28
3,  2 positions 29 and 30
2,  2 positions 31 and 32


Median: there is a 9 in position 16 and an 8 in position 17. We take the average of 8 and 9 and get 8.5 as the median value.

Q1: The is a 6 in both position 24 and 25. The average of 6 and 6 is 6.

Q3: Likewise, there is an 11 in both position 8 and 9. The average of 11 and 11 is 11.

On this list, it was just a coincidence that the median was not a whole number and the two other quartiles were nice round numbers. Any time a quartile is between two positions, there is a chance it will be the average of two different values.


Thursday, November 12, 2015

Using the Consumer Price Index table

The Consumer Price Index

This week, students got a green handout sheet with the consumer price index number for the years 1950 to 2015.  The simplest way to use it goes as follows.

How did prices change from 1960 to 1980? We use the two CPI values.

CPI(1960) = 29.6
CPI(1980) = 82.4

82.4/29.6 = 2.78378.....

29.6/82.4 = .35922...

What these numbers mean is that on average, a $10 item in 1960 sold for 10*2.78378... = $27.84 in 1980, while a $10 item in 1980 would have sold for 10*.35922... = $3.59.

We can use this to figure out the cost of living increase in any given year by dividing the CPI for that year by the CPI for the previous year.  For example, the rate in 1975 would be

CPI(1975)/CPI(1974) = 53.8/49.3 = 1.09127789... This is 1 + rate, so rounded to the nearest tenth of a percent we would have 9.1% and to the nearest hundredth of a percent it would be 9.13%.

Let's look at the number CPI(1980)/CPI(1960) = 2.783783... This gives us how much prices increased in the 20 year period from 1961 to 1980. To get the average increase over those 20 years, we take (2.783783)^(1/20) = 1.05252... This is 1 + rate, so the average rate = .05252... or 5.3% if rounded to the nearest tenth of a percent and 5.25% rounded to the nearest hundredth.

Thursday, November 5, 2015

Answers to Quiz 8


Here are the answers to Quiz 8, which will be counted as a lab instead of a quiz and a new Quiz 8 will be given on Tuesday, with checksums.

Data set: 1990-2009 n = 20

R² =.5956

yp = .1830x - 361.3035

What is the value of yp when you plug in 1990? 2.8665

What is the value of yp when you plug in 2009? 6.3435

95% confidence threshold = .1971 Does R² surpass it? Yes

99% confidence threshold = .3147 Does R² surpass it? Yes

====================


Data set: 1990-2009 n =10

R² =.1601

yp = .1006x -196.0848

What is the value of yp when you plug in 2000? 5.1152

What is the value of yp when you plug in 2009? 6.0206

95% confidence threshold = .3994 Does R² surpass it? No

99% confidence threshold = .5852 Does R² surpass it? No




Links to posts about chi square and goodness of fit


Here is a link to a post about the chi-square table.

Our first application will be goodness of fit.



Tuesday, November 3, 2015

The frequency table solution for TI-83 and TI-84


Put the list of numbers in one list (let's say L1) and the frequencies in a separate list (for simplicity's, make it L2 in this example.) Under the STAT menu, in the CALC sub-menu, choose

2-Var Stats L1, L2

Assuming the frequencies are in the second list, the sum of the y values is n, the size of the sample and the sum of the xy is the sum of all the x values. You then need to divide (sum of xy)/(sum of y) to get the average x-bar.

As for the median, you have to do it by hand, just like the folks with the TI-30xIIs.

Here are the lists from class, the first number x and the second number f(x). The answers are in the comments.

This year's daily differences, 2015 - (avg. 1999-2014)
-9, 1
-8, 3
-7, 4
-6, 7
-5, 13
-4, 15
-3, 12
-2, 16
-1, 11
0, 24
1, 27
2, 24
3, 24
4, 25
5, 18
6, 14
7, 11
8, 8
9, 14
10, 5
11, 7
12, 1
13, 1
14, 4
15, 2
16, 3
17, 5
18, 4
20, 2
21, 1

Here is the list of wins by NFL teams in 2014

12, 5
11, 4
10, 3
9, 4
8, 2
7, 4
6, 3
5, 1
4, 2
3, 2
2, 2

Answers in the comments.


Tuesday, October 27, 2015

Correction to Homework 9 answers


The number for the final test statistic on the back page on should be

t = (75.20-71.70)/sqrt(3.49²/10+.67²/10) = 3.114, which means we should  reject H0.

Sorry for the mistake.