220 likes | 340 Views
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL. STOR 155 Introductory Statistics. Lecture 2: Displaying Distributions with Graphs. Recall. Statistics is the science of data . Collecting Analyzing Decision making Fundamental concepts:
E N D
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL STOR 155 Introductory Statistics Lecture 2: Displaying Distributions with Graphs Lecture 2-1
Recall • Statistics is the science of data. • Collecting • Analyzing • Decision making • Fundamental concepts: • Population, parameter,sample, statistic, sample size. • Any questions? Lecture 2-1
Chapter 1: Looking at Data - Distributioins 1.1 Displaying Distributions with Graphs 1.2 Displaying Distributions with Numbers 1.3 Density Curves and Normal Distributions Lecture 2-1
Data contain • Individuals: the subjects described by the data; • Variables: any characteristic of an individual. A variable can take different values for different individuals. Lecture 2-1
NBA Draft 2005 Lecture 2-1
Categorical & Quantitative Variables • Acategorical variable places an individual into one of several groups or categories. • Aquantitative variable takes numerical values for which arithmetic operations such as adding and averaging make sense. Lecture 2-1
NBA Draft 2005 • Categorical variables • Team, Nationality • Quantitative variables • Weight, Height Lecture 2-1
NBA Draft 2005 • Variables: • Team & Nationality - Categorical • Weight & Height - Quantitative • How many teams in the draft? How many players drafted by each team? • How many players higher than 6-9? How many players between 200 and 250 pounds? • Equivalently, what is the distribution for each variable? Lecture 2-1
Distributions of Variables • Thedistributionof a variable indicates what values a variable takes and how often it takes these values. • For a categorical variable, distribution: categories + count/percent for each category • For a quantitative variable, distribution: pattern of variation of its values Lecture 2-1
Highest Level of Education for People Aged 25-34 Lecture 2-1
Exploratory Data Analysis (EDA) • Use statistical tools and ideas to help us examine data • Goal: to describe the main features of the data • NEVER skip this • EDA • Displaying distributions with graphs • Displaying distributions with numbers Lecture 2-1
Basic Strategies for EDA • Strategy I • One variable at a time • Relationships among the variables • Strategy II • Graphical visualizations • Numerical summaries Lecture 2-1
Graphic Techniques for Categorical Variables • Bar Graph uses bars to represent the frequencies (or relative frequencies) such that the height of each bar equals the frequency or relative frequency of each category. • Frequencies: counts • Relative frequencies: percent • height indicates count or percent • Pie Chart is a circle divided into a number of slices that represent the various categories such that the size of each slice is proportional to the percentage corresponding to that category. • area = relative % • Note: Pie chart requires to include all the categories that make up a whole. Lecture 2-1
Highest Level of Education for People Aged 25-34 Lecture 2-1
Graphic Techniques for Quantitative Variables • Stemplot (Stem-and-Leaf Plot) • Histogram • Time plot Lecture 2-1
Stemplot • Separate each observation into a stem consisting of all but the final (rightmost) digit and a leaf, the final digit. Stems may have as many digits as needed, but each leaf contains only a single digit. • Write the stems in a vertical column with the smallest at the top, and draw a vertical line at the right of this column. • Write each leaf in the row to the right of its stem, in increasing order out from the stem. Lecture 2-1
# of Home Runs per Season • Babe Ruth (New York Yankees): 1920-1934 • 54 59 35 41 46 25 47 60 54 46 49 46 41 34 22 • Mark McGwire (St. Louis Cardinals): 1986:2001 • 3 49 32 33 39 22 42 9 9 39 52 58 70 65 32 29 • Question: (see Ex 1.7 p9 –11 1st…) • Work out the stem-plot of McGwire • back-to-back stem-plot of the two players Lecture 2-1
Example: Midterm Scores of STOR 151 The following data set contains the midterm exam scores of STOR 151. 74 76 78 88 87 87 53 95 82 79 79 78 62 80 77 70 60 60 84 95 85 93 79 84 71 85 100 77 72 95 79 83 97 87 73 84 74 83 85 95 62 50 86 83 86 36 Lecture 2-1
Splitting & Trimming Stems • For a moderate number of obs, • Split each stem into two: one with leaves 0-4 and the other with leaves 5-9 • Increase # of stems, reduce # of leaves • Trimming: • If the observed values have too many digits, you can trim them by rounding to a certain digit. • Disadvantage of stemplots • Awkward for large data sets Lecture 2-1
Example: A study on litter size • Data: (170 observations) 4 6 5 6 7 3 6 4 4 6 4 4 9 5 10 6 6 5 6 8 2 7 7 7 9 3 7 5 7 7 4 5 5 6 7 6 7 8 6 6 7 6 6 7 5 4 5 6 6 1 3 4 7 5 4 7 5 8 8 5 6 8 5 5 4 9 6 7 3 7 7 5 4 6 9 6 7 7 5 7 3 7 6 5 3 7 10 5 6 8 7 5 5 7 5 5 8 9 7 5 7 5 5 5 6 3 7 8 7 7 6 3 4 4 4 7 2 7 8 5 8 6 6 5 6 4 7 5 5 6 9 3 5 4 8 3 9 8 3 6 5 4 7 8 4 8 6 8 5 6 4 3 8 8 6 9 5 5 6 6 7 6 8 6 11 6 5 6 6 3 Lecture 2-1
Stem-and-leaf plot for pups 0|122333333333333344… (35) 0|555555555555555555555555... (132) 1| 001 Lecture 2-1
Take Home Message • Data: • Individuals • Variables • Categorical variables • Quantitative variables • Distribution of variables • Graphical tools for categorical data • Bar graph • Pie chart • Graphical tools for quantitative data • Stemplot Lecture 2-1