Applied Statistics Chapter 2: Analysis of univariate data 1. Representations and graphs. Frequency tables. Bar charts, pictograms, histograms, frequency polygons and box plots 2. Numerical summary. Measures of location. Measures of spread. Measures of form. Recommended reading: • Bad charts • Capítulos 3 a 7 del libro de Portilla (2004) Applied Statistics 2.1: Representations and graphs DESCRIPTION OF QUALITATIVE VARIABLES Absolute frequency Relative frequency Bar chart Pie chart DESCRIPTION OF QUANTITATIVE VARIABLES Absolute frequency / cumulative absolute frequency Relative frequency / cumulative relative frequency Histogram Frequency polygon Recommended reading: Capítulos 3 y 4 del libro de Portilla (2004) Applied Statistics Description of qualitative variables SAMPLE: 70 madrileño university students VARIABLE: Preferred political party OBJECTIVE: Classification and representation of the information PP IU PP IU PP PP IU IU PSOE PSOE IU PP PSOE IU PSOE PSOE PSOE IU IU PSOE Otros IU IU PSOE PP UPD IU PSOE PSOE UPD PP PSOE PP IU PP PSOE PP UPD IU UPD PSOE PSOE PSOE IU PSOE PP PSOE UPD PP PP Otros UPD Otros PSOE IU Otros IU IU PSOE PP Otros IU PSOE PSOE UPD IU PSOE PP IU PSOE Applied Statistics The frequency table Absolute frequency Relative frequency Class (i) ni fi PSOE 23 0,33 PP 15 0,21 IU 20 0,29 UPD 7 0,10 Otros 5 0,07 Total 70 1 = 23+15+20+7+5 = 15/70 = 0,33+0,21+ …+0,07 Applied Statistics The general outline of a frequency table Class (i) ni fi 1 n1 f1 2 n2 f2 3 n3 f3 k nk fk Total N 1 = n1 + n2 +… + nk = f1 + f2 +… + fk = n1/N Applied Statistics The bar chart Applied Statistics How to lie with bar charts Data on the previous computer of iMac owners Previous Ownership Frequency Relative Frequency None 85 0.17 Windows 60 0.12 Macintosh 355 0.71 Total 500 1.00 Applied Statistics It appears that nearly everyone buys Macs … Applied Statistics … but now not so much! Applied Statistics Comparative bar charts http://cnx.org/content/m10927/latest/ Applied Statistics The pie chart 7% 10% 33% 29% 21% Applied Statistics The pictogram PSOE PP IU UPD OTROS The area of the graph is proportional to the frequency. Applied Statistics A real example of a pictogram Applied Statistics How to lie with pictograms Letting height be proportional to frequency gives a false impression. Applied Statistics Exercise TYPE OF CRIME No. Theft 5996 Battery 5059 Criminal damage 3866 Narcotics 3134 Burglary 2289 Assault 1641 Others 1802 Crimes commited in Chicago between 5/11/2009 and 5/12/2009 Summarize these data in graphical form Chicago crime database Applied Statistics Exercise Final grades in a statistics course: GRADE No. Students Didn’t sit exam 17 D/E 16 C 29 B 24 A 2 Is this a nominal or an ordinal variable? What percentage of the students didn’t pass? Are there any other graphs that could be useful here? Applied Statistics Exercise (Test question) The 40 students in a statistics class rate their lecturer from 1 (extremely boring) to 5 (fantastic). The table partially shows the survey results. Evaluation Absolute frequency Relative frequency 1 0,05 2 3 5 4 9 5 19 TOTAL Complete the table. Applied Statistics Exercise (Test question) The following table comes from the CIS survey of January 2011. The values are given as (approximate) percentages of a total number of 2478 respondents.: Which of the following affirmations is correct? a) The number of respondents who have a lot of confidence (mucha confianza) in the Mariano Rajoy is approximately 619. b) Approximately 1953 of the respondents have little or no confidence (poca o ninguna confianza) in the leader of the PP. c) The relative frequency of respondents who don’t know (NS) or don’t reply (NC) is 0.19. d) None of the above. Applied Statistics Exercise (Exam question) The following pie chart shows the distribution of the autonomous communities visited by foreign tourists. Which of the following is the correct response? a) The percentage of tourists who visit the islands is lower than the percentage for the rest of the destinations. b) The percentage of tourists who visit the islands is higher than the percentage for the rest of the destinations. c) Cataluña and the Comunidad de Madrid are the communities with the highest percentages of foreign tourists. d) None of the above. Applied Statistics Exercise (Exam question) The following pie chart concerns the voting concerns of students at the University of Houston University before the 2010 elections. Which of correct? the following affirmations is a) 160 students said that the main issues were Jobs or Immigration. b) 327 students said that the main issues were Public schools or Health care. c) 25 students said that the main issue was Other. d) 259 students said that the main issue was College costs.