1.03k likes | 1.24k Views
Chapter 4: More about Relationships Between Two Variables. 4.1 – Transforming to Achieve Linearity Exponential Growth. Not all data can be expressed with a linear model.
E N D
4.1 – Transforming to Achieve Linearity Exponential Growth
PROBLEM! We cannot use least-squares regression for nonlinear data because least-squares regression depends upon correlation, which only measures the strength of linear relationships. SOLUTION! Transform the data into a linear set, then use the least-squares regression to determine the best fitting line for the transformed data. Finally, do a reverse transformation equation which will model our original nonlinear data.
Properties of Logarithms 1. log ab = log a + log b a b 2. log = log a – log b 3. log xp = p log x Remember: log has a base of 10 and natural logs (ln) have a base of e. It doesn’t matter which one you use.
Linearizing Exponential Functions: We want to write an exponential function of the form y = abx as a linear model. (where x, y are variables and a,b are constants) y = abx log y = log (abx) log y = log a + log bx log y = log a + xlog b (x, log y) (x, y)
CONCLUSIONS: 1. If the graph of (x, y) is exponential, then the graph of (x, log y) is linear. 2. If the graph of (x, log y) is linear, then the graph of (x, y) is exponential.
Example #1 Transform the exponential data to a linear model using logs and then natural logs. y = 5(2)x ln y = ln (5 2x) log y = log (5 2x) ln y = ln 5 + log 2x log y = log 5 + log 2x ln y = ln 5+ xln 2 log y = log 5+ xlog 2 ln y = 1.6094+ 0.6931x log y = 0.69897+ 0.3010x
Example #2 Convert the equation back to an exponential function. ln y = 16 + 9x e e y = e(16 + 9x) y = e(16) e(9x) y = e(16) e(9)x y = 8,886,110.521 8103.0839x
Example #3 Convert the equation back to an exponential function. log y = 4 + 2x 10 10 y = 10(4 + 2x) y = 10(4) 10(2x) y = 10(4) 10(2)x y = 10,000 100x
Calculator Tip: Exponential Functions L1: x L2: y L3: leave blank for now! L4: log y LinReg(L1, L4, Y1) - (x, log y, Y1) To prevent Overload error: convert years to a smaller number
Calculator Tip: Residual Plot After calculating the line of regression: In Lists!
Calculator Tip: Exponential Equation ExpReg(L1, L2, Y2) - (x, y, Y2)
Exponential to Linear Change: 1. The ratio of the y’s should be fairly constant 2. Graph x and y and look at the pattern 3. Calculate the transformed linear model 4. Describe the r value and the residual plot
Example#4: Consider the following data representing the population for Asian and Pacific Islander. 1. Make a scatterplot of the data and describe the graph.
D: Positive, as year increases, population increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s). The ratios of the y’s are fairly consistent, suggesting an exponential model
3. Find r and describe its meaning r = 0.968 D: Positive S: Strong
4. Graph and comment on the residual plot for x and y. Curve, not a good linear model
5. Take the log of the y-values and make a new scatterplot. D: Positive D: Positive F: Nonlinear F: Linear S: Strong S: Strong
6. Find the least squares regression line of the transformed data. Log(Population) = 2.27095 + 0.0156432(Year)
3. Find r and describe its meaning 7. Find the value of r and describe its meaning. r = 0.999999 r = 0.968 D: Positive D: Positive S: Strong S: Strong
8. Construct the residual plot and describe its meaning. 4. Graph and comment on the residual plot for x and y. No pattern, so good linear model Curve, not a good linear model
9. Perform the inverse transformation to express y-hat as an exponential equation. 10 10 y = 10(2.27095 + 0.0156432x) y = 10(2.27095) 10(0.0156432x) y = 10(2.27095) 10(0.0156432)x y = 186.6162 1.0367x
11. Make a prediction for the population in 2010 using both equations. log y = 2.27095 + 0.0156432(110) y = 186.6162 1.0367x log y = 3.991697 y = 186.6162 1.0367(110) 10 10 y = 9810.6342 y = 9,810.6342
Example#5: Consider the following data representing an account balance over time: 1. Make a scatterplot of the data and describe the graph.
D: Positive, as time increases, account balance increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s).
3. Find r and describe its meaning r = 0.9481 D: Positive S: Strong
4. Graph and comment on the residual plot for x and y. Curved, not good linear model
5. Take the natural log of the y-values and make a new scatterplot. D: Positive D: Positive F: Nonlinear F: Linear S: Strong S: Strong
6. Find the least squares regression line of the transformed data. ln(Account Balance) = 4.60516 + 0.00995047(Months)
7. Find r and describe its meaning. 3. Find r and describe its meaning r = 0.999999 r = 0.9481 D: Positive D: Positive S: Strong S: Strong
8. Construct the residual plot and describe its meaning. 4. Graph and comment on the residual plot for x and y. No pattern, so good linear model Curved, not good linear model
9. Perform the inverse transformation to express y-hat as an exponential equation. e e y = e(4.60516 + 0.00995047x) y = e(4.60516) e(0.00995047x) y = e(4.60516) e(0.00995047)x y = 99.9988 1.01x
11. Make a prediction for the account balance in 60 months using both equations. y = 99.9988 1.01x ln y = 4.60516 + 0.00995047(60) y = 99.9988 1.01(60) ln y = 5.20218656728 e e y = $181.67 y = $181.67
A power model is in the form y = axp. To transform this equation into a linear model you must apply the log transformation to both variables x and y. y = axp log y = log (axp) log y = log a + log xp log y = log a + plog x How is this different than exponential functions? You have to take the log of both x and y to make a linear model.
Example #6 Find the LSRL by taking the logs and then the natural logs. y = 4x5 y = 4x5 log y = log (4x5) ln y = ln (4x5) log y = log 4 + log x5 ln y = ln 4 + ln x5 log y = log 4 + 5log x ln y = ln 4 + 5ln x log y = 0.6021 + 5log x ln y = 1.3863 + 5ln x
Example #7 Convert the equation back to a power equation. ln y = -5 + 9ln x e e y = e(-5 + 9lnx) y = e(-5) e(9lnx) y = e(-5) e(lnx)9 y = 0.0067x9
Example #8 Convert the equation back to a power equation. log y = 0.5 + 2log x 10 10 y = 10(0.5 + 2logx) y = 10(0.5) 10(2logx) y = 10(0.5) 10(logx)2 y = 3.1623x2
Calculator Tip: Power Functions L1: x L2: y L3: log x L4: log y LinReg(L3, L4, Y1) - (log x, log y, Y1)
Calculator Tip: Power Equation PwrReg(L1, L2, Y2) - (x, y, Y2)
Example #9 The distances from our sun and the periods of the 9 planets in the solar system are given below. 1. Make a scatterplot of the data and describe the graph.
D: Positive, as distance increases, period increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s). Ratio of y’s are not similar, perhaps not exponential
3. Find r and describe its meaning r = 0.9779 D: Positive S: Strong
4. Graph an exponential model and discuss if it is appropriate to use this model. Curved, not good linear model