Presentation is loading. Please wait.

Presentation is loading. Please wait.

Daniela Stan Raicu School of CTI, DePaul University

Similar presentations


Presentation on theme: "Daniela Stan Raicu School of CTI, DePaul University"— Presentation transcript:

1 Daniela Stan Raicu School of CTI, DePaul University
CSC 323 Quarter: Spring 02/03 Daniela Stan Raicu School of CTI, DePaul University 11/22/2018 Daniela Stan - CSC323

2 Outline Chapter 2: Looking at Data – Relationships between
two or more variables Scatterplots Correlation 11/22/2018 Daniela Stan - CSC323

3 Association Between Variables
Two variables measured on the same individuals are associated if some values of one variable tend to occur more often with some values of the second variable than with other values of that variable. A response variable measures an outcome of a study. An explanatory variable explains or causes changes in the response variable. Explanatory variable ~ independent variable Response variable ~ dependent variable 11/22/2018 Daniela Stan - CSC323

4 Association Between Variables (cont.)
Example 1: A study is conducted to determine if one can predict the yield of a crop based on the amount of yearly rainfall. The response variable in this study is: A. Yield of crop B. Amount of yearly rainfall C. The experimenter D. Either bushels or inches of water Example 2: A researcher is interested in determining if one could predict the score on a statistics exam from the amount of time spent studying for the exam. In this study, the explanatory variable is: A. The researcher B. The amount of time spent studying for the exam C. The score on the exam D. The fact that this is a statistics exam 11/22/2018 Daniela Stan - CSC323

5 Scatterplots A scatterplot displays the relationship between two quantitative variables. The values of one variable appear on the horizontal axis and the values of the other variable appear on the vertical axis. Always plot the explanatory variable, if there is one, on the horizontal axis (the x axis) of a scatterplot. Each individual in the data appears as the point in the plot fixed by the values of both variables for that individual. 11/22/2018 Daniela Stan - CSC323

6 Scatterplots (cont.) Example: State mean SAT mathematics score plotted
against the percent of high school seniors in each state who took the SAT exam. Cluster 2: - Higher scores Linear negative relationship Cluster 1: - Low scores 11/22/2018 Daniela Stan - CSC323

7 Interpreting Scatterplots
The overall pattern of a scatterplot can be described by the: - form - direction - strength of the relationship. Form: - linear or non-linear (curved relationships or clusters) Direction: - positive or negative association Strength: how closely the points follow a clear form: - strong or weak 11/22/2018 Daniela Stan - CSC323

8 Examples of Relationships
11/22/2018 Daniela Stan - CSC323

9 Adding categorical variables
To add a categorical variable to a scatterplot, use a different plot color or symbol for each category. Example: The states are grouped in four regions: Region Midwest Northeast South West Categorical Variable 11/22/2018 Daniela Stan - CSC323

10 Examples on Scatterplots
Problem 2.10 11/22/2018 Daniela Stan - CSC323

11 Measuring Strength & Direction of a Linear Relationship
How closely does a non-horizontal straight line fit the points of a scatterplot? The correlation coefficient (often referred to as just correlation): r measure of the strength of the relationship: the stronger the relationship, the larger the magnitude of r. measure of the direction of the relationship: positive r indicates a positive relationship, negative r indicates a negative relationship. 11/22/2018 Daniela Stan - CSC323

12 Correlation Coefficient
special values for r : a perfect positive linear relationship would have r = +1 a perfect negative linear relationship would have r = -1 if there is no linear relationship, or if the scatterplot points are best fit by a horizontal line, then r = 0 Note: r must be between -1 and +1, inclusive r > 0: as one variable changes, the other variable tends to change in the same direction r < 0: as one variable changes, the other variable tends to change in the opposite direction Plot 11/22/2018 Daniela Stan - CSC323

13 Correlation X Y x1 y1 x2 y2 … xn yn
The correlation r measures the direction and strength of the linear relationship between two quantitative variables. Suppose we have the following data: X Y x1 y1 x2 y2 xn yn Where sx, sy are the standard deviations for the two variables X and Y 11/22/2018 Daniela Stan - CSC323

14 More on Correlation Correlation ignores distinction between explanatory and response variables Correlation requires that both variables be quantitative Correlation is not affected by changes in the unit of measurement of either variable Correlation measures the strength of only linear relationships Correlation is not resistant measure, so outliers can greatly change the value of r. 11/22/2018 Daniela Stan - CSC323

15 Not all Relationships are Linear Miles per Gallon versus Speed
Curved relationship (r is misleading) Speed varies from 20 mph to 60 mph MPG varies from trial to trial, even at the same speed Statistical relationship 11/22/2018 Daniela Stan - CSC323

16 Problems with Correlations
Outliers can inflate or deflate correlations Groups combined inappropriately may mask relationships (a third variable) groups may have different relationships when separated Plot Reading Assignments Chapter 1 Chapter 2 (Sections 2.1 and 2.2) More on correlation: Problem 2.22/ page 132 11/22/2018 Daniela Stan - CSC323

17 What correlation numbers correspond to the points
from the 6 scatterplots from the right? r = 0 r = 0.5 r = 0.9 r = -0.99 r = -0.7 r = -0.3 11/22/2018 Daniela Stan - CSC323


Download ppt "Daniela Stan Raicu School of CTI, DePaul University"

Similar presentations


Ads by Google