560 likes | 696 Vues
Never let time idle away aimlessly. . Chapters 1, 2: Turning Data into Information. Types of data Displaying distributions Describing distributions. What are Data?. Any set of data contains information about some group of individuals. The information is organized in variables.
E N D
Chapters 1, 2: Turning Data into Information Types of data Displaying distributions Describing distributions
What are Data? Any set of data contains information about some group of individuals. The information is organized in variables. Individuals are the objects described by a set of data. Could be animals, people, or things. A variable is any characteristic of an individual. A variable can take different values for different individuals.
Population/Sample/Raw Data • A population is a collection of all individuals about which information is desired. • A sample is a subset of a population. • Raw data: information collected but not been processed.
Example: A College’s Student Dataset The data set includes data about all currently enrolled students such as their ages, genders, heights, grades, and choices of major. • Population/sample/raw data of study? • Who? What individuals do the data describe? • What? How many variables do the data describe? Give an example of variables.
Types of Variables • A categorical variable places an individual into one of several groups or categories. • A quantitative variable takes numerical values for which arithmetic operations such as adding and averaging make sense. Q. Which variable is categorical ? Quantitative?
Q: Does “average” make sense? Yes No Q: Is there any natural ordering among categories? Q: Can all possible values be listed down? No Yes Yes No
Two Basic Strategies to Explore Data • Begin by examining each variable by itself. Then move on to study the relationship among the variables. • Begin with a graph or graphs. Then add numerical summaries of specific aspects of the data.
Summarizing Data Goal: to study or estimate the distributions of variables The distribution of a variable tells us what values/categories it takes and how often it takes those values/categories. • Displaying distributions of data with graphs • Describing distributions of data with numbers
Displaying Distributions of Categorical Variables Calculating these first: • Frequency/counts • Relative frequency/percentage
Displaying Distributions of Categorical Variables • Pie charts: good for one variable • Bar graphs: good for one or two variables and better than pie charts for ordinal variables Example 1.3 (page 9)
Class Make-up on First Day Pie Chart
Class Make-up on First Day Bar Graph
Displaying Distributions of Quantitative Variables • Stem-and-leaf plots: good for small to medium datasets • Histograms: Similar to bar charts; good for medium to large datasets
How to Make a Histogram • Break the range of values of a variable into equal-width intervals. Make sure to specify the classes precisely so that each individuals falls into exactly one class. • Count the # of individuals in each interval. These counts are called frequencies and the corresponding %’s are called relative frequencies. • Draw the histogram: the variable on the horizontal axis and the count (or %) on the vertical axis. *** work on blackboard for height ***
Histograms: Class Intervals • How many intervals? • One rule is to calculate the square root of the sample size, and round up. • Size of intervals? • Divide range of data (maxmin) by number of intervals desired, and round to convenient number • Pick intervals so each observation can only fall in exactly one interval (no overlap)
How to Make a 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. Example: height of 68.5 leaf = “5” and the other digit “68” will be the stem
How to Make a Stemplot • 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.
10 0166 11 009 12 0034578 13 00359 14 08 15 00257 16 555 17 000255 18 000055567 19 245 20 3 21 025 22 0 23 24 25 26 0 Weight Data:Stemplot(Stem & Leaf Plot) Key 20|3 means203 pounds Stems = 10’sLeaves = 1’s
Extended Stem-and-Leaf Plots If there are very few stems (when the data cover only a very small range of values), then we may want to create more stems by splitting the original stems.
151516161717 Extended Stem-and-Leaf Plots Example: if all of the data values were between 150 and 179, then we may choose to use the following stems: Leaves 0-4 would go on each upper stem (first “15”), and leaves 5-9 would go on each lower stem (second “15”).
What do We See from the Graphs? Important features we should look for: • Overall pattern • Shape • Center (the location data tend to cluster to) • Spread (the spread level of data) • Outliers, the values that fall far outside the overall pattern (for quantitative variables only)
Overall Pattern—Shape • How many peaks, called modes? A distribution with one major peak is called unimodal. • Symmetric or skewed? • Symmetric if the large values are mirror images of small values • Skewed to theright if the right tail (large values) is much longer than the left tail (small values) • Skewed to the left if the left tail (small values) is much longer than the right tail (large values) *** Show examples on blackboard. ***
Numerical Summaries for Quantitative Variables (Chapter 2) • To measure center (location): Mode, Meanand Median • To measure spread: Range, Interquartile Range (IQR) and Standard Deviation(SD) • Five-number summaries ** show height • Outliers ** give a large number for the missing height
Mean or Average • Traditional measure of center • Sum the values and divide by the number of values
Median (M) • A resistant measure of the data’s center • At least half of the orderedvalues are less than or equal to the median value • At least half of the ordered values are greater than or equal to the median value • If n is odd, the median is the middle ordered value • If n is even, the median is the average of the two middle ordered values
Median (M) Location of the median: L(M) = (n+1)/2 ,where n = sample size. Example: If 25 data values are recorded, the Median would be the (25+1)/2 = 13th ordered value.
Median • Example 1 data: 2 4 6 Median (M) = 4 • Example 2 data: 2 4 6 8 Median = 5 (ave. of 4 and 6) • Example 3 data: 6 2 4 Median 2 (order the values: 2 4 6 , so Median = 4)
Comparing the Mean & Median • The mean and median of data from a symmetric distribution should be close together. The actual (true) mean and median of a symmetric distribution are exactly the same. • In a skewed distribution, the mean is farther out in the long tail than is the median [the mean is ‘pulled’ in the direction of the possible outlier(s)].
Question A recent newspaper article in California said that the median price of single-family homes sold in the past year in the local area was $136,000 and the mean price was $149,160. Which do you think is more useful to someone considering the purchase of a home, the median or the mean?
Spread, or Variability • If all values are the same, then they all equal the mean. There is no variability. • Variability exists when some values are different from (above or below) the mean. • We will discuss the following measures of spread: range, IQR, and standard deviation
Range • One way to measure spread is to give the smallest (minimum) and largest (maximum) values in the data set; Range = max min • The range is strongly affected by outliers
Quartiles • Three numbers which divide the ordered data into four equal sized groups. • Q1 has 25% of the data below it. • Q2 has 50% of the data below it. (Median) • Q3 has 75% of the data below it.
Obtaining the Quartiles • Orderthe data. • For Q2, just find the median. • For Q1, look at the lower half of the data values, those to the left of the median location; find the median of this lower half. • For Q3, look at the upper half of the data values, those to the right of the median location; find the median of this upper half.
L(M)=(53+1)/2=27 Weight Data: Sorted L(Q1)=(26+1)/2=13.5
Weight Data: Quartiles • Q1= 127.5 • Q2= 165 (Median) • Q3= 185
Interquartile Range (IQR)= Q3 Q1 = 57.5 Five-Number Summary • minimum = 100 • Q1 = 127.5 • M = 165 • Q3 = 185 • maximum = 260 IQRgives spread of middle 50% of the data
Variance and Standard Deviation • Recall that variability exists when some values are different from (above or below) the mean. • Each data value has an associated deviation from the mean:
what is a typical deviation from the mean? (standard deviation) small values of this typical deviation indicate small variability in the data large values of this typical deviation indicate large variability in the data Deviations
Variance • Find the mean • Find the deviation of each value from the mean • Square the deviations • Sum the squared deviations • Divide the sum by n-1 (gives typical squared deviation from mean)
Standard Deviation Formulatypical deviation from the mean [ standard deviation = square root of the variance ]
Variance and Standard DeviationExample from Text Metabolic rates of 7 men (cal./24hr.) : 1792 1666 1362 1614 1460 1867 1439
More Graphs for Quantitative Variables • Boxplots (pages 46 - 49) ** to show location and spread, and identify outliers • Scatterplots ** to see the relationship between two quan. var’s: height vs. weight • Time plots ** a special scatterplot; time is the x-axis ** example 1.10, page 23
Boxplot • Central box spans Q1 and Q3. • A line in the box marks the median M. • Lines extend from the box out to the minimum and maximum.
min Q1 M Q3 max 100 125 150 175 200 225 250 275 Weight Weight Data: Boxplot