Download presentation
Presentation is loading. Please wait.
Published byReynard Bell Modified over 9 years ago
1
The Practice of Statistics Third Edition Chapter 4: More about Relationships between Two Variables Copyright © 2008 by W. H. Freeman & Company Daniel S. Yates
2
Section 4.1 Modeling Nonlinear Data Linear relationship xy y/ x 02.0 5.1 17.1 4.7 211.8 5.3 317.1 5.1 422.2 Constant value y/ x indicate linear relationship y = a + bx
3
Section 4.1 Modeling Nonlinear Data Exponential relationship xyy n /y n-1 01.0 2.1 1 2.0 24.3 1.8 37.9 2.0 416.0 Constant value y n /y n-1 called common ratio indicates exponential relationship y = ab x
4
Section 4.1 Modeling Nonlinear Data Power relationship xyy n /y n-1 y/ x 00.0 2.1 1 7.714.1 216.2 3.337.3 353.5 2.3873.9 4127.4 Neither y n /y n-1 or y/ x are constant indicates possible power relationship y = ax b
5
Section 4.1 Modeling Nonlinear Data Many important real world situations exhibit exponential or power relationships. Exponential and power relationships can be transformed into linear forms so linear regression analysis can be utilized.
8
Linear regression only works for linear models. (That sounds obvious, but when you fit a regression, you can’t take it for granted.) A curved relationship between two variables might not be apparent when looking at a scatterplot alone, but will be more obvious in a plot of the residuals. –Remember, we want to see “nothing” in a plot of the residuals.
9
No regression analysis is complete without a display of the residuals to check that the linear model is reasonable. Residuals often reveal subtleties that were not clear from a plot of the original data.
10
Section 4.1 Modeling Nonlinear Data For exponential relationship – log y is linear with respect to x For power relationship - log y is linear with respect to log x
11
Linear models give a predicted value for each case in the data. We cannot assume that a linear relationship in the data exists beyond the range of the data. Once we venture into new x territory, such a prediction is called an extrapolation.
12
Section 4.2 Interpreting Correlation and Regression r and LSRL describe only linear relationships r and LSRL are strongly influenced by a few extreme observations – influential points Always plot your data The use of a regression line to predict outside the domain of values of the explanatory variable x is called extrapolation and cannot be trusted.
13
Lurking Variables and Causation No matter how strong the association, no matter how large the R 2 value, no matter how straight the line, there is no way to conclude from a regression alone that one variable causes the other. –There’s always the possibility that some third variable is driving both of the variables you have observed. With observational data, as opposed to data from a designed experiment, there is no way to be sure that a lurking variable is not the cause of any apparent association.
14
Section 4.2 Interpreting Correlation and Regression Lurking variables are variables that can influence the relationship of two variables. Lurking variables are not measured or even considered. Lurking variables can falsely suggest a strong relationship between two variables or even hide a relationship.
15
Lurking Variables and Causation (cont.) The following scatterplot shows that the average life expectancy for a country is related to the number of doctors per person in that country:
16
Lurking Variables and Causation (cont.) This new scatterplot shows that the average life expectancy for a country is related to the number of televisions per person in that country:
17
Lurking Variables and Causation (cont.) Since televisions are cheaper than doctors, send TVs to countries with low life expectancies in order to extend lifetimes. Right? How about considering a lurking variable? That makes more sense… –Countries with higher standards of living have both longer life expectancies and more doctors (and TVs!). –If higher living standards cause changes in these other variables, improving living standards might be expected to prolong lives and increase the numbers of doctors and TVs.
19
Strong association of variables x and y can reflect any of the following underlying relationships –Causation - changes in x cause changes in y –ex. Consuming more calories with no change in physical activity causes weight gain. –Common response – both x and y respond to some unobserved variable or variables. –ex. There may be perceived cause and effect between SAT scores and undergrad GPA but both variables are likely responding to student knowledge and ability
20
–Confounding – the effect on y of the explanatory variable x is mixed up with the effects on y of other lurking variables. –ex. Minority students have lower ave. SAT scores than whites; but minorities on average grew up in poorer households and attended poorer schools. These socioeconomic variables make cause and effect suspect.
21
Strong Association
24
A carefully designed experiment is the best way to get evidence that x causes y. Lurking variables must be kept under control.
25
Section 4.3 Relations in Categorical Data Categorical data may be inherently categorical such as; sex,race and occupation. Categorical data may be created by grouping quantitative data. Two way tables – hold categorical data
26
Income 25-3435-5455 +Total 0- 19,999 4,5062,7383,40010,644 20,000- 39,999 8,7245,6224,78919,135 40,000- 49,999 12,64316,8937,64237,178 Total25,87325,25315,83166,957 Age Group example Row variable – Income Column variable - Age
27
The totals of the rows and column are called marginal distributions. The totals may be off from the table data due to rounding error. The data may also be represented by percents. Relationships between categorical data may be calculated from the two way table. Data may be represented by a bar chart.
28
Conditional distributions satisfy a certain condition on the table. –Ex. Distribution of income level for 25-34 year olds. –Ex. Distribution of age for people making $20,000 - $39,999
29
Example OutcomeHospital A Hospital B Total Died 63 (3%) 16 (2%) 79 Survived 2037 (97%) 784 (98%) 2,821 Total 2,1008002,900
30
OutcomeHospital A Hospital B Hospital A Hospital B Died6 (1%) 8 (1.3%) 57 (3.8%) 8 (4%) Survived594 (99%) 592 (98.7%) 1,443 (96.2%) 192 (96%) Total600 1,500200 Good ConditionPoor Condition Lurking Variable
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.