STAT 250 Dr. Kari Lock Morgan Describing Data II SECTIONS 2.3, 2.4, 2.5 One quantitative variable (2.3, 2.4) One quantitative by one categorical (2.4) Two quantitative (2.5)
The 95% Rule The standard deviation for hours of sleep per night is closest to ½ 1 2 4 I have no idea
z-score The z-score for a data value, x, is 𝑧= 𝑥− 𝑥 𝑠 for sample data, and 𝑧= 𝑥−𝜇 𝜎 for population data. z-score measures the number of standard deviations away from the mean
z-score A z-score puts values on a common scale A z-score is the number of standard deviations a value falls from the mean For symmetric, bell-shaped distributions, 95% of all z-scores fall between -2 and 2, so z-scores beyond these values can be considered extreme
z-score Which is better, an ACT score of 28 or a combined SAT score of 2100? ACT: = 21, = 5 SAT: = 1500, = 325 Assume ACT and SAT scores have approximately bell-shaped distributions ACT score of 28 SAT score of 2100 I don’t know
Other Measures of Location Maximum = largest data value Minimum = smallest data value Quartiles: Q1 = median of the values below m. Q3 = median of the values above m.
Five Number Summary Five Number Summary: Min Max Q1 Q3 m 25% Minitab: Stat -> Basic Statistics -> Display Descriptive Statistics
Five Number Summary > summary(study_hours) Min. 1st Qu. Median 3rd Qu. Max. 2.00 10.00 15.00 20.00 69.00 The distribution of number of hours spent studying each week is Symmetric Right-skewed Left-skewed Impossible to tell
The Pth percentile is the value which is greater than P% of the data We already used z-scores to determine whether an SAT score of 2100 or an ACT score of 28 is better We could also have used percentiles: ACT score of 28: 91st percentile SAT score of 2100: 97th percentile
Five Number Summary Five Number Summary: Min Max Q1 Q3 m 25% 0th percentile 25th percentile 50th percentile 75th percentile 100th percentile
Measures of Spread Range = Max – Min Interquartile Range (IQR) = Q3 – Q1 Is the range resistant to outliers? Yes No Is the IQR resistant to outliers?
Comparing Statistics Measures of Center: Measures of Spread: Mean (not resistant) Median (resistant) Measures of Spread: Standard deviation (not resistant) IQR (resistant) Range (not resistant) Most often, we use the mean and the standard deviation, because they are calculated based on all the data values, so use all the available information
Boxplot Lines (“whiskers”) extend from each quartile to the most extreme value that is not an outlier Q3 Middle 50% of data Median Q1 Minitab: Graph -> Boxplot -> One Y -> Simple
Boxplot Outlier *For boxplots, outliers are defined as any point more than 1.5 IQRs beyond the quartiles (although you don’t have to know that)
Boxplot This boxplot shows a distribution that is Symmetric Left-skewed Right-skewed
Summary: One Quantitative Variable Summary Statistics Center: mean, median Spread: standard deviation, range, IQR 5 number summary Percentiles Visualization Dotplot Histogram Boxplot Other concepts Shape: symmetric, skewed, bell-shaped Outliers, resistance z-scores
Quantitative and Categorical Relationships Interested in a quantitative variable broken down by categorical groups
Side-by-Side Boxplots Minitab: Graph -> Boxplot -> One Y -> With Groups
Stacked Dotplots Minitab: Graph -> Dotplot -> One Y -> With Groups
Overlaid Histograms Minitab: Graph -> Histogram -> With Groups
Quantitative Statistics by a Categorical Variable Any of the statistics we use for a quantitative variable can be looked at separately for each level of a categorical variable Minitab: Stat -> Basic Statistics -> Display Descriptive Statistics -> By variables
Difference in Means Often, when comparing a quantitative variable across two categories, we compute the difference in means 𝑥 𝐹 − 𝑥 𝑀 =25.586 −24.466=1.12
Summary: One Quantitative and One Categorical Summary Statistics Any summary statistics for quantitative variables, broken down by groups Difference in means Visualization Side-by-side graphs
Two Quantitative Variables Summary Statistics: correlation Visualization: scatterplot
Scatterplot A scatterplot is the graph of the relationship between two quantitative variables. Minitab: Graph -> Scatterplot -> Simple
Direction of Association A positive association means that values of one variable tend to be higher when values of the other variable are higher A negative association means that values of one variable tend to be lower when values of the other variable are higher Two variables are not associated if knowing the value of one variable does not give you any information about the value of the other variable
Exploring Associations In the states data, explore the associations between obesity rate and the following variables: PhysicalActivity: % doing physical activity in the past month Smokers: % who smoke Population: State population (in millions) HouseholdIncome: Mean household income (in $) McCainVote: % voting for McCain in 2008 election IQ: Mean IQ score Make your initial guesses…
Associations Minitab: Graph -> Scatterplot -> Simple -> Multiple Graphs -> In separate panels of the same graph
Correlation The correlation is a measure of the strength and direction of linear association between two quantitative variables Sample correlation: r Population correlation: (“rho”) Minitab: Stat -> Basic Statistics -> Correlation
What are the properties of correlation? Correlations What are the properties of correlation?
Correlation
Correlation Guessing Game http://www.istics.net/Correlations/ Enter PennState for the group ID.
Correlation NFL Teams r = 0.43
Testosterone Levels and Time What is the correlation between testosterone levels and hour of the day? Positive Negative About 0 Are testosterone level and hour of the day associated? Yes No
TVs and Life Expectancy
Correlation Cautions Correlation can be heavily affected by outliers. Always plot your data! r = 0 means no linear association. The variables could still be otherwise associated. Always plot your data! Correlation does not imply causation!
Summary: Two Quantitative Variables Summary Statistics: correlation Visualization: scatterplot
Lots of Scatterplots Minitab: Graph -> Matrix Plot
3 Variables: Adding a Categorical Variable to a Scatterplot Minitab: Graph -> Scatterplot -> With Groups
3 Variables: Adding a Quantitative Variable to a Scatterplot Minitab: Graph -> Bubble Plot -> Simple
Four Variables!: Adding a categorical and a quantitative variable to a scatterplot Minitab: Graph -> Bubble Plot -> With Groups
Scatterplot with Histograms/Boxplots/Dotplots Minitab: Graph -> Marginal Plot
To Do Read Sections 2.4 and 2.5 Do Homework 2.2, 2.3, 2.4, 2.5 (due Friday, 2/6)