Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Never let time idle away aimlessly.. 2 Chapters 1, 2: Turning Data into Information Types of data Displaying distributions Describing distributions.

Similar presentations


Presentation on theme: "1 Never let time idle away aimlessly.. 2 Chapters 1, 2: Turning Data into Information Types of data Displaying distributions Describing distributions."— Presentation transcript:

1 1 Never let time idle away aimlessly.

2 2 Chapters 1, 2: Turning Data into Information Types of data Displaying distributions Describing distributions

3 3 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.

4 4 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.

5 5 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.

6 6 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?

7 7 A variable Categorical/ Qualitative Nominal variable Ordinal variable Numerical/ Quantitative Discrete variable Continuous variable Q: Does “average” make sense? Yes No Yes Q: Is there any natural ordering among categories?Q: Can all possible values be listed down?

8 8 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.

9 9 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

10 10 A Dataset of CSUEB Students GenderHeight (inches) Weight (pounds) College M68.5155Bsns F61.299Bsns F63.0115Arts M70.0205Arts F68.6170Arts F65.1125Bsns M72.4220Arts M--188Bsns

11 11 Displaying Distributions of Categorical Variables Calculating these first: Frequency/counts Relative frequency/percentage

12 12 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)

13 13 YearCountPercent Freshman1841.9% Sophomore1023.3% Junior614.0% Senior920.9% Total43100.1% Class Make-up on First Day

14 14 Pie Chart Class Make-up on First Day

15 15 Class Make-up on First Day Bar Graph

16 16 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

17 17 How to Make a Histogram 1. 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. 2. Count the # of individuals in each interval. These counts are called frequencies and the corresponding %’s are called relative frequencies. 3. Draw the histogram: the variable on the horizontal axis and the count (or %) on the vertical axis. *** work on blackboard for height ***

18 18 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 (max  min) by number of intervals desired, and round to convenient number Pick intervals so each observation can only fall in exactly one interval (no overlap)

19 19 How to Make a Stemplot 1. 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

20 20 How to Make a Stemplot 2. Write the stems in a vertical column with the smallest at the top, and draw a vertical line at the right of this column. 3. Write each leaf in the row to the right of its stem, in increasing order out from the stem.

21 21 Weight Data: Stemplot (Stem & Leaf Plot) 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 Key 20 | 3 means 203 pounds Stems = 10’s Leaves = 1’s

22 22 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.

23 23 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: 15 15 16 16 17 17 Leaves 0-4 would go on each upper stem (first “15”), and leaves 5-9 would go on each lower stem (second “15”).

24 24 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)

25 25 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 the right 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. ***

26 26 Numerical Summaries for Quantitative Variables (Chapter 2) To measure center (location): Mode, Mean and 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

27 27 Mean or Average Traditional measure of center Sum the values and divide by the number of values

28 28 Median (M) A resistant measure of the data’s center At least half of the ordered values 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

29 29 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 = 13 th ordered value.

30 30 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)

31 31 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)].

32 32 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?

33 33 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

34 34 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

35 35 Quartiles Three numbers which divide the ordered data into four equal sized groups. Q 1 has 25% of the data below it. Q 2 has 50% of the data below it. (Median) Q 3 has 75% of the data below it.

36 36 Obtaining the Quartiles Order the data. For Q 2, just find the median. For Q 1, 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 Q 3, look at the upper half of the data values, those to the right of the median location; find the median of this upper half.

37 37 Weight Data: Sorted L(M)=(53+1)/2=27 L(Q 1 )=(26+1)/2=13.5

38 38 Weight Data: Quartiles Q 1 = 127.5 Q 2 = 165 (Median) Q 3 = 185

39 39 Five-Number Summary minimum = 100 Q 1 = 127.5 M = 165 Q 3 = 185 maximum = 260 Interquartile Range (IQR) = Q 3  Q 1 = 57.5 IQR gives spread of middle 50% of the data

40 40 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:

41 41 Deviations 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

42 42 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)

43 43 Variance Formula

44 44 Standard Deviation Formula typical deviation from the mean [ standard deviation = square root of the variance ]

45 45 Variance and Standard Deviation Example from Text Metabolic rates of 7 men (cal./24hr.) : 1792 1666 1362 1614 1460 1867 1439

46 46 Variance and Standard Deviation Example from Text ObservationsDeviationsSquared deviations 1792 1792  1600 = 192 (192) 2 = 36,864 1666 1666  1600 = 66 (66) 2 = 4,356 1362 1362  1600 = -238 (-238) 2 = 56,644 1614 1614  1600 = 14 (14) 2 = 196 1460 1460  1600 = -140 (-140) 2 = 19,600 1867 1867  1600 = 267 (267) 2 = 71,289 1439 1439  1600 = -161 (-161) 2 = 25,921 sum = 0sum = 214,870

47 47 Variance and Standard Deviation Example from Text

48 48 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

49 49 Boxplot Central box spans Q 1 and Q 3. A line in the box marks the median M. Lines extend from the box out to the minimum and maximum.

50 50 M Weight Data: Boxplot Q1Q1 Q3Q3 minmax 100 125 150 175 200 225 250 275 Weight

51 51 Example from Text: Boxplots

52 52 Identifying Outliers The central box of a boxplot spans Q 1 and Q 3 ; recall that this distance is the Interquartile Range (IQR). We call an observation a suspected outlier if it falls more than 1.5  IQR above the third quartile or below the first quartile.

53 53 Time Plots A time plot shows behavior over time. Time is always on the horizontal axis, and the variable being measured is on the vertical axis. Look for an overall pattern (trend), and deviations from this trend. Connecting the data points by lines may emphasize this trend. Look for patterns that repeat at known regular intervals (seasonal variations).

54 54 Class Make-up on First Day (Fall Semesters: 1985-1993)

55 55 Average Tuition (Public vs. Private)

56 Graphs for the Relation of Two Variables 1 categorical + 1 quantitative var’s: 2 quantitative var’s: 2 categorical var’s: 56


Download ppt "1 Never let time idle away aimlessly.. 2 Chapters 1, 2: Turning Data into Information Types of data Displaying distributions Describing distributions."

Similar presentations


Ads by Google