Showing posts with label graphic presentation of data. Show all posts
Showing posts with label graphic presentation of data. Show all posts

Sunday, May 11, 2014

Notes for May 6th and 8th

Bayesian probability

If a trait is very rare, only a very accurate test gives us useful information. For example, if a trait shows up in only 1 in 10,000 people but the test for the trait has an error rate of 1 in 1,000, we should expect about 10 false positives for every true positive. Here is the completed table for that situation.

________don't___have____row total

test + ____9,999__999______10,998__

test - _9,989,001___1_____9,989,002__

col.___9,999,000_1,000______10,000,000 grand total

In a situation such as this, testing positive twice could give us useful information, as testing positive once has an error rate of about 90.9%. We have to assume the errors are random and not deterministic. For example, if a test for a chemical compound in opium also catches a similar compound found in poppy seed bagels, testing twice won't get rid of the errors. Assuming just random errors here is what we do.

Step 1: The top row of the first contingency table is the column total/grand total row of the second contingency table. What this does is takes the numbers from the people who tested positive the first time and makes them the totals for those who will be tested twice.

________don't___have____row total

test + __________________________

test - __________________________

col._______9,999__999_____10,998 grand total

Step 2: Multiply error rate by have column total to find the number who have that test negative. Round to the nearest whole number. (We didn't have to round before, but now we do.)
999*1/1000 = .999 ~= 1, this means test positive and have is 998.

________don't___have____row total

test + ___________998____________

test - _____________1____________

col._______9,999__999_____10,998 grand total

Step 3: Multiply error rate by don't have column total to find the errors. 9,999*1/1000 = 9.999 ~= 10. That means the test negative in that column is 9,999 - 10 = 9,989.

________don't___have____row total

test + _______10__998____________

test - _____9,989____1____________

col._______9,999__999_____10,998 grand total

Step 4: row totals

________don't___have____row total

test + _______10__998_____1,008___

test - _____9,989____1_____9,990___

col._______9,999__999_____10,998 grand total

Step 5: Find the error rate for testing positive twice. 10/1,008 = .0099... or about 1%.

Of the ten million people tested, we would send letters to 1,008 telling them they tested positive twice. Of those people, ten don't have the trait and are getting false information, but 998 are getting the right information. In the first test, there was someone with the trait who tested negative, and the same is true in the second test, so there are two people with the trait who did not get two positive test results. While this isn't a perfect situation, it's much better than the over 90% error rate we got for positive tests the first time through. 

Relative frequency charts and ogives

Relative frequencies are also known as proportions and can sometimes be considered probabilities. If the proportions correspond to ordered categories, a line chart can be a clear way to present the data.

Here is the data for the Los Angeles Angels scoring by inning, given as percentages. The first number is the percentage scored in that inning and the second number in brackets is the percentage of entire runs scored in a game up through that inning.

1st: 13.5% [13.5%]
2nd: 10.0% [23.5%]
3rd: 10.4% [33.9%]
4th: 11.0% [45.0%]
5th: 11.7% [56.6%]
6th: 11.7% [68.3%]
7th: 8.8% [77.1%]
8th: 12.3% [89.4%]
9th: 9.4% [98.8%]
extra innings: 1.2% [100.0%]

The Angels are fairly consistent, except for the big bump in the first inning and the drop-off in the 7th. Unsurprisingly, they score very few extra inning runs, though some teams like the Giants score four times as many.


In a line graph, we have two possible options. The first is the line in blue, which shows the production inning by inning. The red line shows the cumulative numbers and that graph is called the ogive, pronounced "oh-jive". If they were completely consistent, the ogive would be a completely straight line, but instead we see the slight bends in the red line when run production increased and decreases per inning.








Monday, June 29, 2009

Representing the age at death demographics


The graphical representation of three different groups and their relative frequencies in multiple demographic categories makes the most sense in a bar chart with multiple colors. Red represents the whole population, green represents the Caucasian sub-population and blue represents the African American sub-population.

Click on the picture to see a larger version.

Tuesday, February 24, 2009

Class notes for 2/23


Sometimes, graphic presentation of data uses pictograms instead of bars from bar charts or pie charts. It's best when this information is used one-dimensionally instead of two dimensionally. For example, using the record icon for albums sold is a one dimensional representation, and gives the information correctly. One stack is about 8 records tall (7 full records and a partial record) while the other stack is 5 records tall.

The icon of a gold bar is not as well used, because the bar is made both wider and taller. The ratio between the prices is 741.25/265.50, which is about 2.79, which means the higher price is a little less than three times the lower price. The gold bars have been made both wider and taller, so if we take the ratio of the rectangle sizes (92*54)/(35*21), we have the the big gold bar is about 6.78 times the size of the small one, which is nearer to 2.79*2.79. It's better to represent the information as just a height or just a width and not both, for exactly the reason presented here.

The test will cover material from all the class so far, so reading your notes, reading the online notes and reviewing homework and quizzes is the best use of your time studying.

Tuesday, February 17, 2009

graphic presentation of data


This is a collection of statistics taken from the Atlantic Monthly magazine showing before and after statistics from the beginning and the end of the Bush administration. Most of the before numbers come from 2000, though some come from 2001, and the after numbers are from 2006, 2007 or 2008. There will be questions asked about the numbers here, so you can click on the picture to get a larger version. If you are on a computer where you are allowed to save files, you can left click on the picture and scroll down to "Save Image As..." to download the file to your computer. There will be questions on future practice problem sets that will ask about the data presented here.